Submission #696319

#TimeUsernameProblemLanguageResultExecution timeMemory
696319stevancvCollecting Stamps 3 (JOI20_ho_t3)C++14
0 / 100
0 ms212 KiB
// GPT TESTING #include <bits/stdc++.h> using namespace std; const int N=210; int n,l,cnt,ans,x[N],t[N]; bool cmp(int a,int b){ return t[a]<t[b]; } int main(){ scanf("%d%d",&n,&l); for(int i=0;i<n;i++){ scanf("%d",&x[i]); x[i+n]=x[i]+l; } for(int i=0;i<n;i++){ scanf("%d",&t[i]); } for(int i=0;i<n;i++){ cnt=0; vector<int>v; for(int j=0;j<n*2;j++){ int tmp=(j+i)%n; if(x[j]<=x[i]+t[i]){ cnt++; v.push_back(tmp); } } ans=max(ans,cnt); for(int j=0;j<cnt-1;j++){ if(x[v[j+1]+n]-x[v[j]]>t[v[j]]){ ans=max(ans,j+1); break; } } } printf("%d\n",ans); return 0; }

Compilation message (stderr)

ho_t3.cpp: In function 'int main()':
ho_t3.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d%d",&n,&l);
      |     ~~~~~^~~~~~~~~~~~~~
ho_t3.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d",&x[i]);
      |         ~~~~~^~~~~~~~~~~~
ho_t3.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%d",&t[i]);
      |         ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...