Submission #153948

#TimeUsernameProblemLanguageResultExecution timeMemory
153948georgerapeanuSterilizing Spray (JOI15_sterilizing)C++11
5 / 100
5067 ms3864 KiB
#include <cstdio> using namespace std; const int NMAX = 1e5; int n,q,k; int pula[NMAX + 5]; int main(){ scanf("%d %d %d",&n,&q,&k); for(int i = 1;i <= n;i++){ scanf("%d",&pula[i]); } while(q--){ int t,a,b; scanf("%d %d %d",&t,&a,&b); if(t == 1){ pula[a] = b; } else if(t == 2){ for(int i = a;i <=b;i++)pula[i] /= k; } else{ long long sum = 0; for(int i = a;i <=b;i++){ sum += pula[i]; } printf("%lld\n",sum); } } return 0; }

Compilation message (stderr)

sterilizing.cpp: In function 'int main()':
sterilizing.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d",&n,&q,&k);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~
sterilizing.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&pula[i]);
         ~~~~~^~~~~~~~~~~~~~~
sterilizing.cpp:19:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d %d",&t,&a,&b);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...