제출 #971552

#제출 시각아이디문제언어결과실행 시간메모리
971552alo_54Traffic (IOI10_traffic)C++14
0 / 100
1 ms4472 KiB
#include "traffic.h" #include <bits/stdc++.h> using namespace std; int LocateCentre(int N, int P[], int S[], int D[]) { int sumR = 0, sumL = 0; for (int i = 1; i < N; i++) { sumR += P[i]; } int minW = sumR, maxL = -1, idxOpt = 0; for (int i = 1; i < N; i++) { sumL += P[i -1]; sumR -= P[i]; maxL = max(sumL, sumR); if (maxL < minW) { idxOpt = i; minW = maxL; } } return minW; }

컴파일 시 표준 에러 (stderr) 메시지

traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:15:32: warning: variable 'idxOpt' set but not used [-Wunused-but-set-variable]
   15 |    int minW = sumR, maxL = -1, idxOpt = 0;
      |                                ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...