Submission #797166

# Submission time Handle Problem Language Result Execution time Memory
797166 2023-07-29T07:36:27 Z vjudge1 Food Court (JOI21_foodcourt) C++17
2 / 100
1000 ms 524288 KB

// Author : حسن

#include <bits/stdc++.h>



using namespace std;

#define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rall(s) s.rbegin(),s.rend()
#define all(s) s.begin(),s.end()
#define pb push_back
#define fi first
#define se second
#define ll long long
#define ld long double
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define yes cout<<"yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define no cout<<"no\n"


const int N = 7e4 + 9 , mod = 1e9 + 7;
ll  a[N] = {},  us[N] , dp[N] = {} , b[N];
deque<int>d[N];
void solve(){
    ll q , i , j , m ,n, z , s  = 0, f, l , r , k , x , y , mn  = 1e18 , mx = -1;
    cin>>n>>m>>q;
    while(q--){
        cin>>k;
        if(k == 1){
            cin>>l>>r>>x>>y;
            for(i = l; i <=r ;i++)
                d[i].pb(x);
        }else if(k == 2){
            cin>>l>>r>>x;
            for(i = l; i <= r; i++){
                s = 0;
                while(d[i].size() && s < x){
                    d[i].pop_front();
                    s++;
                }
            }
        }else{
            cin>>x>>y;
            if(d[x].size() >= y)
                cout<<d[x][y - 1]<<"\n";
            else
                cout<<0<<"\n";
        }
    }
}

int main(){

     TL;
     /*
     #ifndef ONLINE_JUDGE
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
     #endif
     */
int t = 1;
//cin>>t;

while(t--)
     {
     solve();
     }

}
// Author : حسن

Compilation message

foodcourt.cpp: In function 'void solve()':
foodcourt.cpp:50:28: warning: comparison of integer expressions of different signedness: 'std::deque<int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   50 |             if(d[x].size() >= y)
      |                ~~~~~~~~~~~~^~~~
foodcourt.cpp:31:16: warning: unused variable 'j' [-Wunused-variable]
   31 |     ll q , i , j , m ,n, z , s  = 0, f, l , r , k , x , y , mn  = 1e18 , mx = -1;
      |                ^
foodcourt.cpp:31:26: warning: unused variable 'z' [-Wunused-variable]
   31 |     ll q , i , j , m ,n, z , s  = 0, f, l , r , k , x , y , mn  = 1e18 , mx = -1;
      |                          ^
foodcourt.cpp:31:38: warning: unused variable 'f' [-Wunused-variable]
   31 |     ll q , i , j , m ,n, z , s  = 0, f, l , r , k , x , y , mn  = 1e18 , mx = -1;
      |                                      ^
foodcourt.cpp:31:61: warning: unused variable 'mn' [-Wunused-variable]
   31 |     ll q , i , j , m ,n, z , s  = 0, f, l , r , k , x , y , mn  = 1e18 , mx = -1;
      |                                                             ^~
foodcourt.cpp:31:74: warning: unused variable 'mx' [-Wunused-variable]
   31 |     ll q , i , j , m ,n, z , s  = 0, f, l , r , k , x , y , mn  = 1e18 , mx = -1;
      |                                                                          ^~
# Verdict Execution time Memory Grader output
1 Correct 29 ms 47532 KB Output is correct
2 Correct 30 ms 47788 KB Output is correct
3 Correct 32 ms 49024 KB Output is correct
4 Correct 33 ms 50216 KB Output is correct
5 Correct 26 ms 47432 KB Output is correct
6 Correct 26 ms 47444 KB Output is correct
7 Correct 37 ms 50100 KB Output is correct
8 Correct 34 ms 49484 KB Output is correct
9 Correct 34 ms 48020 KB Output is correct
10 Correct 34 ms 49412 KB Output is correct
11 Correct 35 ms 48692 KB Output is correct
12 Correct 33 ms 47800 KB Output is correct
13 Correct 33 ms 48340 KB Output is correct
14 Correct 36 ms 48516 KB Output is correct
15 Correct 33 ms 48448 KB Output is correct
16 Correct 36 ms 48492 KB Output is correct
17 Correct 30 ms 47616 KB Output is correct
18 Correct 32 ms 47584 KB Output is correct
19 Correct 30 ms 47508 KB Output is correct
20 Correct 26 ms 47456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 47532 KB Output is correct
2 Correct 30 ms 47788 KB Output is correct
3 Correct 32 ms 49024 KB Output is correct
4 Correct 33 ms 50216 KB Output is correct
5 Correct 26 ms 47432 KB Output is correct
6 Correct 26 ms 47444 KB Output is correct
7 Correct 37 ms 50100 KB Output is correct
8 Correct 34 ms 49484 KB Output is correct
9 Correct 34 ms 48020 KB Output is correct
10 Correct 34 ms 49412 KB Output is correct
11 Correct 35 ms 48692 KB Output is correct
12 Correct 33 ms 47800 KB Output is correct
13 Correct 33 ms 48340 KB Output is correct
14 Correct 36 ms 48516 KB Output is correct
15 Correct 33 ms 48448 KB Output is correct
16 Correct 36 ms 48492 KB Output is correct
17 Correct 30 ms 47616 KB Output is correct
18 Correct 32 ms 47584 KB Output is correct
19 Correct 30 ms 47508 KB Output is correct
20 Correct 26 ms 47456 KB Output is correct
21 Incorrect 31 ms 47464 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 938 ms 47468 KB Output is correct
2 Correct 690 ms 48720 KB Output is correct
3 Correct 938 ms 48656 KB Output is correct
4 Correct 931 ms 48588 KB Output is correct
5 Correct 695 ms 48708 KB Output is correct
6 Correct 708 ms 48708 KB Output is correct
7 Correct 38 ms 48236 KB Output is correct
8 Correct 39 ms 48212 KB Output is correct
9 Execution timed out 1092 ms 48708 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 64 ms 96060 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 29 ms 47532 KB Output is correct
2 Correct 30 ms 47788 KB Output is correct
3 Correct 32 ms 49024 KB Output is correct
4 Correct 33 ms 50216 KB Output is correct
5 Correct 26 ms 47432 KB Output is correct
6 Correct 26 ms 47444 KB Output is correct
7 Correct 37 ms 50100 KB Output is correct
8 Correct 34 ms 49484 KB Output is correct
9 Correct 34 ms 48020 KB Output is correct
10 Correct 34 ms 49412 KB Output is correct
11 Correct 35 ms 48692 KB Output is correct
12 Correct 33 ms 47800 KB Output is correct
13 Correct 33 ms 48340 KB Output is correct
14 Correct 36 ms 48516 KB Output is correct
15 Correct 33 ms 48448 KB Output is correct
16 Correct 36 ms 48492 KB Output is correct
17 Correct 30 ms 47616 KB Output is correct
18 Correct 32 ms 47584 KB Output is correct
19 Correct 30 ms 47508 KB Output is correct
20 Correct 26 ms 47456 KB Output is correct
21 Correct 938 ms 47468 KB Output is correct
22 Correct 690 ms 48720 KB Output is correct
23 Correct 938 ms 48656 KB Output is correct
24 Correct 931 ms 48588 KB Output is correct
25 Correct 695 ms 48708 KB Output is correct
26 Correct 708 ms 48708 KB Output is correct
27 Correct 38 ms 48236 KB Output is correct
28 Correct 39 ms 48212 KB Output is correct
29 Execution timed out 1092 ms 48708 KB Time limit exceeded
30 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 774 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 29 ms 47532 KB Output is correct
2 Correct 30 ms 47788 KB Output is correct
3 Correct 32 ms 49024 KB Output is correct
4 Correct 33 ms 50216 KB Output is correct
5 Correct 26 ms 47432 KB Output is correct
6 Correct 26 ms 47444 KB Output is correct
7 Correct 37 ms 50100 KB Output is correct
8 Correct 34 ms 49484 KB Output is correct
9 Correct 34 ms 48020 KB Output is correct
10 Correct 34 ms 49412 KB Output is correct
11 Correct 35 ms 48692 KB Output is correct
12 Correct 33 ms 47800 KB Output is correct
13 Correct 33 ms 48340 KB Output is correct
14 Correct 36 ms 48516 KB Output is correct
15 Correct 33 ms 48448 KB Output is correct
16 Correct 36 ms 48492 KB Output is correct
17 Correct 30 ms 47616 KB Output is correct
18 Correct 32 ms 47584 KB Output is correct
19 Correct 30 ms 47508 KB Output is correct
20 Correct 26 ms 47456 KB Output is correct
21 Incorrect 31 ms 47464 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 29 ms 47532 KB Output is correct
2 Correct 30 ms 47788 KB Output is correct
3 Correct 32 ms 49024 KB Output is correct
4 Correct 33 ms 50216 KB Output is correct
5 Correct 26 ms 47432 KB Output is correct
6 Correct 26 ms 47444 KB Output is correct
7 Correct 37 ms 50100 KB Output is correct
8 Correct 34 ms 49484 KB Output is correct
9 Correct 34 ms 48020 KB Output is correct
10 Correct 34 ms 49412 KB Output is correct
11 Correct 35 ms 48692 KB Output is correct
12 Correct 33 ms 47800 KB Output is correct
13 Correct 33 ms 48340 KB Output is correct
14 Correct 36 ms 48516 KB Output is correct
15 Correct 33 ms 48448 KB Output is correct
16 Correct 36 ms 48492 KB Output is correct
17 Correct 30 ms 47616 KB Output is correct
18 Correct 32 ms 47584 KB Output is correct
19 Correct 30 ms 47508 KB Output is correct
20 Correct 26 ms 47456 KB Output is correct
21 Incorrect 31 ms 47464 KB Output isn't correct
22 Halted 0 ms 0 KB -