Submission #380403

# Submission time Handle Problem Language Result Execution time Memory
380403 2021-03-21T14:53:38 Z Fidisk Sweeping (JOI20_sweeping) C++14
1 / 100
18000 ms 19072 KB
#include <bits/stdc++.h>
using namespace std;

#define oo 1e15
#define fi first
#define se second
#define sp(iiii) setprecision(iiii)
#define IO ios_base::sync_with_stdio(false); cin.tie(0)
#define ms(aaaa,xxxx) memset(aaaa,xxxx,sizeof(aaaa))
#define cntbit(xxxx) __builtin_popcount(xxxx)
#define getbit(xxxx,aaaa) ((xxxx>>(aaaa-1))&1)

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pair<int,int>,int> piii;
typedef pair<long long,long long> pll;
typedef pair<pair<long long,long long>,long long> plll;
typedef pair<pair<long long,long long>,pair<long long,long long>> pllll;
typedef pair<pair<long long,long long>,bool> pllb;

const ll base=361;
const ll mod=1e9+7;
const ld eps=1e-5;
const ll maxn=1e7-1;

ll n,m,q,i,t,j,q1;
pll a[500009];

int main(){
    IO;
    cin>>n>>m>>q;
    for (i=1;i<=m;i++) {
        cin>>a[i].fi>>a[i].se;
    }
    for (i=1;i<=q;i++) {
        cin>>t;
        if (t==1) {
            cin>>q1;
            cout<<a[q1].fi<<' '<<a[q1].se<<'\n';
        }
        else if (t==2) {
            cin>>q1;
            for (j=1;j<=m;j++) {
                if (a[j].se<=q1) {
                    a[j].fi=max(n-q1,a[j].fi);
                }
                //cout<<a[j].fi<<' '<<a[j].se<<'\n';
            }
            //cout<<"-------------------\n";
        }
        else if (t==3) {
            cin>>q1;
            for (j=1;j<=m;j++) {
                if (a[j].fi<=q1) {
                    a[j].se=max(n-q1,a[j].se);
                }
                //cout<<a[j].fi<<' '<<a[j].se<<'\n';
            }
            //cout<<"-------------------\n";
        }
        else {
            m++;
            cin>>a[m].fi>>a[m].se;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 10 ms 492 KB Output is correct
2 Correct 6 ms 492 KB Output is correct
3 Correct 3 ms 492 KB Output is correct
4 Correct 10 ms 492 KB Output is correct
5 Correct 25 ms 492 KB Output is correct
6 Correct 6 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 238 ms 18156 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 18028 ms 19072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 18028 ms 19072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 492 KB Output is correct
2 Correct 6 ms 492 KB Output is correct
3 Correct 3 ms 492 KB Output is correct
4 Correct 10 ms 492 KB Output is correct
5 Correct 25 ms 492 KB Output is correct
6 Correct 6 ms 492 KB Output is correct
7 Incorrect 238 ms 18156 KB Output isn't correct
8 Halted 0 ms 0 KB -