이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |