제출 #1040075

#제출 시각아이디문제언어결과실행 시간메모리
1040075hotboy2703Sweeping (JOI20_sweeping)C++17
1 / 100
18040 ms82612 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...