제출 #1034052

#제출 시각아이디문제언어결과실행 시간메모리
1034052Zicrus선물상자 (IOI15_boxes)C++17
0 / 100
2072 ms348 KiB
#include <bits/stdc++.h> #include "boxes.h" using namespace std; typedef long long ll; ll delivery(int n, int k, int l, int p11[]) { vector<ll> p(n); for (int i = 0; i < n; i++) p[i] = p11[i]; ll sum; ll first = 0, last = k-1; while (last < n-1) { sum += min(p[first], l-p[first]) + min(p[last]-p[first], l-(p[last]-p[first])) + min(p[last], l-p[last]); } return sum; }

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

boxes.cpp: In function 'll delivery(int, int, int, int*)':
boxes.cpp:16:12: warning: 'sum' may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |     return sum;
      |            ^~~
#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...