답안 #971185

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
971185 2024-04-28T06:05:12 Z AIF_is_carving 푸드 코트 (JOI21_foodcourt) C++17
9 / 100
1000 ms 389672 KB
#include <bits/stdc++.h>
 
typedef long long ll;
using namespace std;

int main(){   
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);



    int n, m, q;
    cin>>n>>m>>q;

    vector<int> court[n+1];
    vector<int> start(n+1);
    for(int i=0; i<n+1; i++) start[i] = 0;

    for(int i=0; i<q; i++){
        int t; cin>>t;
        if(t == 1){
            int l, r, c, k;
            cin>>l>>r>>c>>k;

            for(int i=l; i<=r; i++){
                court[i].push_back(c);
            }

        }
        else if(t == 2){
            int l, r, k;
            cin>>l>>r>>k;

            for(int i=l; i<=r; i++){
                if(start[i]+k<=court[i].size()){
                    start[i]=start[i]+k;
                }
                else{
                    start[i]=court[i].size();
                }
            }
        }
        else{
            int a, b; cin>>a>>b;
            if(start[a]+b-1<court[a].size()) cout<<court[a][start[a]+b-1]<<"\n";
            else cout<<0<<"\n";
        }


        //for(int i=1; i<=n; i++) cout<<start[i]<<" ";

        // for(int i=1; i<=n; i++){
        //     cout<<start[i]<<" ";
        //     for(auto x: court[i]) cout<<x<<" ";

        //     cout<<"\n";
        // }
        // cout<<"\n";
    }

    return 0;

}
 

Compilation message

foodcourt.cpp: In function 'int main()':
foodcourt.cpp:35:30: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |                 if(start[i]+k<=court[i].size()){
foodcourt.cpp:45:28: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |             if(start[a]+b-1<court[a].size()) cout<<court[a][start[a]+b-1]<<"\n";
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1884 KB Output is correct
2 Correct 4 ms 3344 KB Output is correct
3 Correct 4 ms 3928 KB Output is correct
4 Correct 7 ms 7000 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 6 ms 5212 KB Output is correct
8 Correct 6 ms 5204 KB Output is correct
9 Correct 6 ms 4956 KB Output is correct
10 Correct 6 ms 5468 KB Output is correct
11 Correct 6 ms 5468 KB Output is correct
12 Correct 6 ms 5212 KB Output is correct
13 Correct 9 ms 7772 KB Output is correct
14 Correct 11 ms 8540 KB Output is correct
15 Correct 5 ms 4444 KB Output is correct
16 Correct 9 ms 8792 KB Output is correct
17 Correct 4 ms 2652 KB Output is correct
18 Correct 5 ms 3932 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1884 KB Output is correct
2 Correct 4 ms 3344 KB Output is correct
3 Correct 4 ms 3928 KB Output is correct
4 Correct 7 ms 7000 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 6 ms 5212 KB Output is correct
8 Correct 6 ms 5204 KB Output is correct
9 Correct 6 ms 4956 KB Output is correct
10 Correct 6 ms 5468 KB Output is correct
11 Correct 6 ms 5468 KB Output is correct
12 Correct 6 ms 5212 KB Output is correct
13 Correct 9 ms 7772 KB Output is correct
14 Correct 11 ms 8540 KB Output is correct
15 Correct 5 ms 4444 KB Output is correct
16 Correct 9 ms 8792 KB Output is correct
17 Correct 4 ms 2652 KB Output is correct
18 Correct 5 ms 3932 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 856 KB Output is correct
21 Incorrect 1 ms 344 KB Output isn't correct
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 539 ms 4324 KB Output is correct
2 Correct 410 ms 5624 KB Output is correct
3 Correct 547 ms 5884 KB Output is correct
4 Correct 530 ms 5792 KB Output is correct
5 Correct 414 ms 6760 KB Output is correct
6 Correct 432 ms 6648 KB Output is correct
7 Correct 12 ms 1372 KB Output is correct
8 Correct 13 ms 1368 KB Output is correct
9 Correct 893 ms 5404 KB Output is correct
10 Correct 893 ms 5504 KB Output is correct
11 Correct 906 ms 5456 KB Output is correct
12 Correct 872 ms 5316 KB Output is correct
13 Correct 160 ms 4644 KB Output is correct
14 Correct 243 ms 5712 KB Output is correct
15 Correct 41 ms 5808 KB Output is correct
16 Correct 51 ms 6732 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 40 ms 14672 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1884 KB Output is correct
2 Correct 4 ms 3344 KB Output is correct
3 Correct 4 ms 3928 KB Output is correct
4 Correct 7 ms 7000 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 6 ms 5212 KB Output is correct
8 Correct 6 ms 5204 KB Output is correct
9 Correct 6 ms 4956 KB Output is correct
10 Correct 6 ms 5468 KB Output is correct
11 Correct 6 ms 5468 KB Output is correct
12 Correct 6 ms 5212 KB Output is correct
13 Correct 9 ms 7772 KB Output is correct
14 Correct 11 ms 8540 KB Output is correct
15 Correct 5 ms 4444 KB Output is correct
16 Correct 9 ms 8792 KB Output is correct
17 Correct 4 ms 2652 KB Output is correct
18 Correct 5 ms 3932 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 856 KB Output is correct
21 Correct 539 ms 4324 KB Output is correct
22 Correct 410 ms 5624 KB Output is correct
23 Correct 547 ms 5884 KB Output is correct
24 Correct 530 ms 5792 KB Output is correct
25 Correct 414 ms 6760 KB Output is correct
26 Correct 432 ms 6648 KB Output is correct
27 Correct 12 ms 1372 KB Output is correct
28 Correct 13 ms 1368 KB Output is correct
29 Correct 893 ms 5404 KB Output is correct
30 Correct 893 ms 5504 KB Output is correct
31 Correct 906 ms 5456 KB Output is correct
32 Correct 872 ms 5316 KB Output is correct
33 Correct 160 ms 4644 KB Output is correct
34 Correct 243 ms 5712 KB Output is correct
35 Correct 41 ms 5808 KB Output is correct
36 Correct 51 ms 6732 KB Output is correct
37 Execution timed out 1082 ms 389672 KB Time limit exceeded
38 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 4444 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1884 KB Output is correct
2 Correct 4 ms 3344 KB Output is correct
3 Correct 4 ms 3928 KB Output is correct
4 Correct 7 ms 7000 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 6 ms 5212 KB Output is correct
8 Correct 6 ms 5204 KB Output is correct
9 Correct 6 ms 4956 KB Output is correct
10 Correct 6 ms 5468 KB Output is correct
11 Correct 6 ms 5468 KB Output is correct
12 Correct 6 ms 5212 KB Output is correct
13 Correct 9 ms 7772 KB Output is correct
14 Correct 11 ms 8540 KB Output is correct
15 Correct 5 ms 4444 KB Output is correct
16 Correct 9 ms 8792 KB Output is correct
17 Correct 4 ms 2652 KB Output is correct
18 Correct 5 ms 3932 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 856 KB Output is correct
21 Incorrect 1 ms 344 KB Output isn't correct
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1884 KB Output is correct
2 Correct 4 ms 3344 KB Output is correct
3 Correct 4 ms 3928 KB Output is correct
4 Correct 7 ms 7000 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 6 ms 5212 KB Output is correct
8 Correct 6 ms 5204 KB Output is correct
9 Correct 6 ms 4956 KB Output is correct
10 Correct 6 ms 5468 KB Output is correct
11 Correct 6 ms 5468 KB Output is correct
12 Correct 6 ms 5212 KB Output is correct
13 Correct 9 ms 7772 KB Output is correct
14 Correct 11 ms 8540 KB Output is correct
15 Correct 5 ms 4444 KB Output is correct
16 Correct 9 ms 8792 KB Output is correct
17 Correct 4 ms 2652 KB Output is correct
18 Correct 5 ms 3932 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 856 KB Output is correct
21 Incorrect 1 ms 344 KB Output isn't correct
22 Halted 0 ms 0 KB -