Submission #1073121

#TimeUsernameProblemLanguageResultExecution timeMemory
1073121edogawa_somethingA Light Inconvenience (CEOI23_light)C++17
0 / 100
1 ms344 KiB
#include "light.h" #include <vector> #include<bits/stdc++.h> using namespace std; int cnt; vector<long long>v; void prepare(){ cnt = 1; v.push_back(1); } std::pair<long long, std::vector<long long>> join(long long p){ cnt+=p; vector<long long> vv; vv.push_back(1); for(auto &it:v) it+=p; for(long long i=1;1;) { long long res=1; for(auto it:v) { if((2ll*i+p)>=it) res=max(res,min(it,2ll*i)); } if(res>=cnt) { vv.push_back(cnt); break; } else vv.push_back(res); i=res; } v=vv; vector<long long>ans; for(auto it:v) ans.push_back(cnt-it+1); return {p,v}; } std::pair<long long, std::vector<long long>> leave(long long p){ cnt-=p; vector<long long> vv,vvv; vvv=v; v.clear(); for(auto it:vvv) { if(it-p>0) v.push_back(it-p); } vv.push_back(1); for(long long i=1;1;) { long long res=1; for(auto it:v) { if((2ll*i+p)>=it) res=max(res,min(it,2ll*i)); } if(res>=cnt) { vv.push_back(cnt); break; } else vv.push_back(res); i=res; } v=vv; vector<long long>ans; for(auto it:v) ans.push_back(cnt-it+1); return {p,v}; }

Compilation message (stderr)

light.cpp: In function 'std::pair<long long int, std::vector<long long int> > join(long long int)':
light.cpp:34:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   34 |  for(auto it:v)
      |  ^~~
light.cpp:36:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   36 |   return {p,v};
      |   ^~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...