Submission #153948

# Submission time Handle Problem Language Result Execution time Memory
153948 2019-09-17T14:48:06 Z georgerapeanu Sterilizing Spray (JOI15_sterilizing) C++11
5 / 100
5000 ms 3864 KB
#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

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 time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 2 ms 252 KB Output is correct
4 Correct 6 ms 376 KB Output is correct
5 Correct 7 ms 360 KB Output is correct
6 Correct 7 ms 380 KB Output is correct
7 Correct 7 ms 376 KB Output is correct
8 Correct 7 ms 376 KB Output is correct
9 Correct 7 ms 376 KB Output is correct
10 Correct 7 ms 376 KB Output is correct
11 Correct 7 ms 376 KB Output is correct
12 Correct 7 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1734 ms 2988 KB Output is correct
2 Correct 1081 ms 2612 KB Output is correct
3 Correct 1717 ms 2712 KB Output is correct
4 Correct 2809 ms 3448 KB Output is correct
5 Correct 3586 ms 3776 KB Output is correct
6 Correct 3635 ms 3820 KB Output is correct
7 Correct 3580 ms 3720 KB Output is correct
8 Correct 3593 ms 3864 KB Output is correct
9 Execution timed out 5026 ms 2800 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 115 ms 868 KB Output is correct
2 Correct 257 ms 808 KB Output is correct
3 Correct 410 ms 1016 KB Output is correct
4 Correct 876 ms 1792 KB Output is correct
5 Correct 3547 ms 2424 KB Output is correct
6 Correct 3538 ms 2408 KB Output is correct
7 Correct 3618 ms 2580 KB Output is correct
8 Correct 3545 ms 2312 KB Output is correct
9 Execution timed out 5062 ms 1636 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1299 ms 2416 KB Output is correct
2 Correct 1509 ms 2484 KB Output is correct
3 Correct 796 ms 1864 KB Output is correct
4 Correct 1110 ms 2596 KB Output is correct
5 Correct 3563 ms 3556 KB Output is correct
6 Correct 3586 ms 3668 KB Output is correct
7 Correct 3622 ms 3612 KB Output is correct
8 Correct 3566 ms 3600 KB Output is correct
9 Execution timed out 5067 ms 2620 KB Time limit exceeded
10 Halted 0 ms 0 KB -