답안 #257906

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
257906 2020-08-05T04:06:41 Z 반딧불(#5055) Employment (JOI16_employment) C++17
10 / 100
5000 ms 1656 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, q;
int arr[200002];

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

    while(q--){
        int qt;
        scanf("%d", &qt);
        if(qt == 1){
            int qd;
            scanf("%d", &qd);
            int cnt = 0;
            for(int i=1; i<=n; i++){
                if(arr[i] < qd) continue;
                cnt++;
                while(i<n && arr[i+1] >= qd) i++;
            }

            printf("%d\n", cnt);
        }
        else{
            int qx, qy;
            scanf("%d %d", &qx, &qy);
            arr[qx] = qy;
        }
    }
}

Compilation message

employment.cpp: In function 'int main()':
employment.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &q);
     ~~~~~^~~~~~~~~~~~~~~~~
employment.cpp:12:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=1; i<=n; i++) scanf("%d", &arr[i]);
                             ~~~~~^~~~~~~~~~~~~~~
employment.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &qt);
         ~~~~~^~~~~~~~~~~
employment.cpp:19:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &qd);
             ~~~~~^~~~~~~~~~~
employment.cpp:31:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d %d", &qx, &qy);
             ~~~~~^~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 4 ms 384 KB Output is correct
9 Correct 4 ms 384 KB Output is correct
10 Correct 9 ms 384 KB Output is correct
11 Correct 7 ms 384 KB Output is correct
12 Correct 9 ms 384 KB Output is correct
13 Correct 12 ms 384 KB Output is correct
14 Correct 9 ms 384 KB Output is correct
15 Correct 9 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 384 KB Output is correct
2 Correct 27 ms 384 KB Output is correct
3 Correct 19 ms 384 KB Output is correct
4 Correct 873 ms 888 KB Output is correct
5 Correct 3792 ms 1408 KB Output is correct
6 Execution timed out 5098 ms 1656 KB Time limit exceeded
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 4 ms 384 KB Output is correct
9 Correct 4 ms 384 KB Output is correct
10 Correct 9 ms 384 KB Output is correct
11 Correct 7 ms 384 KB Output is correct
12 Correct 9 ms 384 KB Output is correct
13 Correct 12 ms 384 KB Output is correct
14 Correct 9 ms 384 KB Output is correct
15 Correct 9 ms 384 KB Output is correct
16 Correct 25 ms 384 KB Output is correct
17 Correct 27 ms 384 KB Output is correct
18 Correct 19 ms 384 KB Output is correct
19 Correct 873 ms 888 KB Output is correct
20 Correct 3792 ms 1408 KB Output is correct
21 Execution timed out 5098 ms 1656 KB Time limit exceeded
22 Halted 0 ms 0 KB -