Submission #1046900

# Submission time Handle Problem Language Result Execution time Memory
1046900 2024-08-07T06:01:46 Z 김은성(#11022) Sweeping (JOI20_sweeping) C++17
1 / 100
18000 ms 7764 KB
#include <bits/stdc++.h>
using namespace std;
int x[1500009], y[1500009];
int main(){
	int n, m, q, i, j, t, p, l, a, b;
	scanf("%d %d %d", &n, &m, &q);
	for(i=1; i<=m; i++){
		scanf("%d %d", &x[i], &y[i]);
	}
	for(i=0; i<q; i++){
		scanf("%d", &t);
		if(t==1){
			scanf("%d", &p);
			printf("%d %d\n", x[p], y[p]);
		}
		else if(t==2){
			scanf("%d", &l);
			for(j=1; j<=m; j++){
				if(y[j] <= l)
					x[j] = max(x[j], n-l);
			}
		}
		else if(t==3){
			scanf("%d", &l);
			for(j=1; j<=m; j++){
				if(x[j] <= l)
					y[j] = max(y[j], n-l);
			}
		}
		else{
			scanf("%d %d", &a, &b);
			m++;
			x[m] = a;
			y[m] = b;
		}
	}
	return 0;
}

Compilation message

sweeping.cpp: In function 'int main()':
sweeping.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |  scanf("%d %d %d", &n, &m, &q);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
sweeping.cpp:8:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |   scanf("%d %d", &x[i], &y[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
sweeping.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d", &t);
      |   ~~~~~^~~~~~~~~~
sweeping.cpp:13:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |    scanf("%d", &p);
      |    ~~~~~^~~~~~~~~~
sweeping.cpp:17:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |    scanf("%d", &l);
      |    ~~~~~^~~~~~~~~~
sweeping.cpp:24:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |    scanf("%d", &l);
      |    ~~~~~^~~~~~~~~~
sweeping.cpp:31:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |    scanf("%d %d", &a, &b);
      |    ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2392 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2508 KB Output is correct
6 Correct 3 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 18062 ms 7268 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 18052 ms 7764 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 18052 ms 7764 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2392 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 4 ms 2396 KB Output is correct
5 Correct 12 ms 2508 KB Output is correct
6 Correct 3 ms 2396 KB Output is correct
7 Execution timed out 18062 ms 7268 KB Time limit exceeded
8 Halted 0 ms 0 KB -