Submission #799811

# Submission time Handle Problem Language Result Execution time Memory
799811 2023-08-01T04:55:00 Z 반딧불(#10081) Sweeping (JOI20_sweeping) C++17
1 / 100
18000 ms 15996 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int L, n, q;
int px[1500002], py[1500002];

int main(){
    scanf("%d %d %d", &L, &n, &q);
    for(int i=1; i<=n; i++) scanf("%d %d", &px[i], &py[i]);
    while(q--){
        int qt, qa;
        scanf("%d %d", &qt, &qa);
        if(qt==1){
            printf("%d %d\n", px[qa], py[qa]);
        }
        else if(qt==2){
            for(int i=1; i<=n; i++){
                if(px[i] < L-qa && py[i] <= qa) px[i] = L-qa;
            }
        }
        else if(qt==3){
            for(int i=1; i<=n; i++){
                if(px[i] <= qa && py[i] < L-qa) py[i] = L-qa;
            }
        }
        else if(qt==4){
            px[++n] = qa;
            scanf("%d", &py[n]);
        }
    }
}

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]
   11 |     scanf("%d %d %d", &L, &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
sweeping.cpp:12:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for(int i=1; i<=n; i++) scanf("%d %d", &px[i], &py[i]);
      |                             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
sweeping.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         scanf("%d %d", &qt, &qa);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~
sweeping.cpp:31:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |             scanf("%d", &py[n]);
      |             ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 9 ms 468 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 9 ms 468 KB Output is correct
5 Correct 22 ms 380 KB Output is correct
6 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 18025 ms 14768 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 18035 ms 15996 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 18035 ms 15996 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 468 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 9 ms 468 KB Output is correct
5 Correct 22 ms 380 KB Output is correct
6 Correct 5 ms 340 KB Output is correct
7 Execution timed out 18025 ms 14768 KB Time limit exceeded
8 Halted 0 ms 0 KB -