Submission #321499

#TimeUsernameProblemLanguageResultExecution timeMemory
321499egasLasers (NOI19_lasers)C++14
24 / 100
104 ms1516 KiB
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); long long l; cin >> l; long long r; cin >> r; long long res=0; for(long long i = 0 ; i < r ; i++) { long long x; cin >> x; vector<long long> a(x); for(long long i = 0 ; i < x ; i++) { cin >> a[i]; } long long sum=accumulate(a.begin(),a.end(),0LL); long long cur=0; for(long long j = 0 ; j < a.size() ; j++) { long long meat=a[j]; long long dem=l-(sum-a[j]); if(meat>=(dem/2)) { long double temp = meat - (dem/2.0); cur+=(long long)(temp/0.5); } } res=max(res,cur); } cout << res << '\n'; return 0; }

Compilation message (stderr)

lasers.cpp: In function 'int32_t main()':
lasers.cpp:39:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |         for(long long j = 0 ; j < a.size() ; j++) {
      |                               ~~^~~~~~~~~~
#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...