제출 #143078

#제출 시각아이디문제언어결과실행 시간메모리
143078model_codeArranging Shoes (IOI19_shoes)Java
30 / 100
193 ms12524 KiB
public class shoes { public long count_swaps(int[] S) { int current = 0, opposite = 0; long swaps = 0; while (current < S.length) { while (S[current] + S[opposite] != 0) { opposite++; } int newSwaps = opposite - current - (S[current] < 0 ? 1 : 0); swaps += newSwaps; if (newSwaps > 0) { S[opposite] = S[opposite - 1]; } current += 2; opposite++; } return swaps; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...