Submission #908102

#TimeUsernameProblemLanguageResultExecution timeMemory
908102ibm2006Segway (COI19_segway)C++17
0 / 100
2 ms12632 KiB
#include<bits/stdc++.h> using namespace std; typedef long long int ll; ll n,i,j,k,l,r,x,y,z,w,s,t,a[1100000],b[1100000],c[1100000],d[1100000],chk[1100000],tt[1100000],q,m,ans[1100000]; int main() { scanf("%lld",&n); for(i=1;i<=n;i++) { scanf("%lld %lld %lld",&x,&y,&z); a[i]=x; b[i]=y; c[i]=z; } scanf("%lld",&m); scanf("%lld",&x); for(i=1;i<=n;i++) { if(x<=100) { d[i]=x*a[i]; continue; } if(x<=200) { d[i]=100*a[i]+(x-100)*b[i]; continue; } d[i]=100*a[i]+100*b[i]+(x-200)*c[i]; } for(i=1;i<=n;i++) { chk[d[i]]++; } for(i=30001;i>=0;i--) { tt[i]=s%20; s+=chk[i]; } for(i=1;i<=n;i++) { for(j=0;j<300;j++) { if(q>0) { ans[i]++; q--; continue; } if(j==x) { q=tt[d[i]]; q--; ans[i]++; continue; } if(j<100) ans[i]+=a[i]; else if(j<200) ans[i]+=b[i]; else ans[i]+=c[i]; } } for(i=1;i<=n;i++) printf("%lld\n",ans[i]); }

Compilation message (stderr)

segway.cpp: In function 'int main()':
segway.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%lld",&n);
      |     ~~~~~^~~~~~~~~~~
segway.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%lld %lld %lld",&x,&y,&z);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
segway.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     scanf("%lld",&m);
      |     ~~~~~^~~~~~~~~~~
segway.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     scanf("%lld",&x);
      |     ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...