Submission #260846

# Submission time Handle Problem Language Result Execution time Memory
260846 2020-08-11T05:38:24 Z 반딧불(#5074) Sweeping (JOI20_sweeping) C++17
1 / 100
26 ms 896 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, m, q;
int x[10002], y[10002];

int main(){
    scanf("%d %d %d", &n, &m, &q);
    for(int i=1; i<=m; i++){
        scanf("%d %d", &x[i], &y[i]);
    }

    for(int i=1; i<=q; i++){
        int qt;
        scanf("%d", &qt);
        if(qt == 1){
            int p;
            scanf("%d", &p);
            printf("%d %d\n", x[p], y[p]);
        }
        else if(qt == 4){
            int a, b;
            scanf("%d %d", &a, &b);
            m++;
            x[m] = a, y[m] = b;
        }
        else if(qt == 2){
            int l;
            scanf("%d", &l);
            for(int i=1; i<=m; i++){
                if(y[i] <= l) x[i] = max(x[i], n-l);
            }
        }
        else{
            int l;
            scanf("%d", &l);
            for(int i=1; i<=m; i++){
                if(x[i] <= l) y[i] = max(y[i], n-l);
            }
        }
    }
}

Compilation message

sweeping.cpp: In function 'int main()':
sweeping.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, &m, &q);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
sweeping.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &x[i], &y[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
sweeping.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &qt);
         ~~~~~^~~~~~~~~~~
sweeping.cpp:21:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &p);
             ~~~~~^~~~~~~~~~
sweeping.cpp:26:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d %d", &a, &b);
             ~~~~~^~~~~~~~~~~~~~~~~
sweeping.cpp:32:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &l);
             ~~~~~^~~~~~~~~~
sweeping.cpp:39:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &l);
             ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 11 ms 512 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 3 ms 512 KB Output is correct
4 Correct 13 ms 420 KB Output is correct
5 Correct 26 ms 384 KB Output is correct
6 Correct 6 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 6 ms 896 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5 ms 896 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5 ms 896 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 512 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 3 ms 512 KB Output is correct
4 Correct 13 ms 420 KB Output is correct
5 Correct 26 ms 384 KB Output is correct
6 Correct 6 ms 384 KB Output is correct
7 Execution timed out 6 ms 896 KB Time limit exceeded (wall clock)
8 Halted 0 ms 0 KB -