이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
#define pll pair <ll,ll>
#define fi first
#define se second
#define MP make_pair
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1)
#define MASK(i) (1LL << (i))
const ll INF = 1e18;
const ll MAXN = 1.5e6+100;
struct query{
ll t,p,x,y;
};
pll a[MAXN];
ll val[MAXN*2];
ll dsu[MAXN*2];
ll side[MAXN*2];
vector <ll> comp[MAXN*2];
ll n,m,q;
int main(){
ios_base::sync_with_stdio(0);cin.tie(nullptr);
cin>>n>>m>>q;
vector <query> all;
ll ptr = 0;
for (ll i = 1;i <= m;i ++){
ll x,y;
cin>>x>>y;
a[++ptr] = MP(x,y);
}
ll cnt=0;
for (ll i = 1;i <= q;i ++){
ll t;
cin>>t;
if (t==1){
ll p;
cin>>p;
cout<<a[p].fi<<' '<<a[p].se<<'\n';
}
if (t==2){
ll x;
cin>>x;
for (ll j = 1;j <= ptr;j ++){
if (a[j].se <= x)a[j].fi = max(a[j].fi,n-x);
}
// all.push_back({2,-1,x,-1});
}
if (t==3){
ll x;
cin>>x;
for (ll j = 1;j <= ptr;j ++){
if (a[j].fi <= x)a[j].se = max(a[j].se,n-x);
}
// all.push_back({3,-1,x,-1});
}
if (t==4){
ll x,y;
cin>>x>>y;
a[++ptr] = MP(x,y);
}
}
// dnc(0,n,all);
// for (ll i = 1;i <= cnt;i ++)cout<<ans[i].fi<<' '<<ans[i].se<<'\n';
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
sweeping.cpp: In function 'int main()':
sweeping.cpp:33:8: warning: unused variable 'cnt' [-Wunused-variable]
33 | ll cnt=0;
| ^~~
# | 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... |