제출 #440225

#제출 시각아이디문제언어결과실행 시간메모리
440225BaraaArmoush사탕 분배 (IOI21_candies)C++17
0 / 100
106 ms19624 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int minimize(int& x, int y) { if (x > y) { x = y; } } int maximize(int& x, int y) { if (x < y) { x = y; } } vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = c.size(); int q = l.size(); vector<int> a(n); for (int j = 0; j < q; j++) { for (int i = l[j]; i <= r[j]; i++) { a[i - 1] += v[j]; maximize(a[i - 1], 0); minimize(a[i - 1], c[i - 1]); } } return a; }

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

candies.cpp: In function 'int minimize(int&, int)':
candies.cpp:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^
candies.cpp: In function 'int maximize(int&, int)':
candies.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
#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...