# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
720401 | 2023-04-08T06:57:34 Z | vjudge1 | 디지털 회로 (IOI22_circuit) | C++17 | 0 ms | 0 KB |
#include<bits/stdc++.h> #define INF 1e9+7 #define ll long long #define ull unsigned ll #define pii pair<int,int> #define pll pair<ll,ll> #define pcc pair<char,char> #define pdd pair<double,double> #define pipii pair<int,pii> #define plpll pair<ll,pll> #define vi vector<int> #define vvi vector<vi> #define v3i vector<vvi> #define v4i vector<v3i> #define fi first #define se second #define mp make_pair #define eb emplace_back #define ins insert #define ln '\n' #define all(v) v.begin(),v.end() using namespace std; void init(int n,int m,int p[],int a[]){ } void solve(){ int n,m,q; cin>>n>>m>>q; int p[n+m]; for(int i=0;i<n+m;i++){ cin>>p[i]; } int a[m]; for(int i=0;i<m;i++){ cin>>a[i]; } int l,r,ans0=0; while(q--){ cin>>l>>r; for(int i=l;i<=r;i++){ a[i-n]^=1; } for(int i=n;i<n+m;i++){ ans0+=a[i-n]; } cout<<ans0<<ln; ans0=0; } } signed main () { ios_base::sync_with_stdio(false); cin.tie(NULL); int t=1; while(t--){ solve(); } } /* 10 10 0 1 10 100 1 1 5 3 1 7 9 8 0 1 10 9 2 1 2 3 2 9 4 0 1 10 100 1 1 10 2 0 1 10 1000 2 1 5 2 0 1 6 1 0 ll 10 1 2 2 4 4 8 4 9 2 5 1 3 3 6 6 10 3 7 */