답안 #914295

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
914295 2024-01-21T14:41:31 Z edogawa_something Mixture (BOI20_mixture) C++17
0 / 100
1 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define pb push_back
#define all(v) v.begin(),v.end()
#define pow poww
const ll M=1e5+10;
const ll inf=2e18;
const ll mod=1e9+7;
ll pow(ll x,ll y){
  ll res=1;
  x%=mod; 
  while(y>0){
    if((y&1))
    res*=x,res%=mod;
    x*=x,x%=mod;
    y=(y>>1);
  }
  return res;
}
ll n,cc[M][2],cchk[3][3],t=1;
map<pii,ll>chk;
int main(){
  ios_base::sync_with_stdio(0),cin.tie(0);
  ll TC=1;
  //cin>>TC;
  while(TC--){
    ll x,y,z;
    cin>>x>>y>>z;
    cin>>n;
    for(int i=0;i<n;i++){
      char ch;
      cin>>ch;
      if(ch=='R'){
        ll ind;
        cin>>ind;
        chk[{cc[ind][0],cc[ind][1]}]--;
      }
      else{
        ll a,b,c;
        cin>>a>>b>>c;
        a*=y*z,b*=x*z,c*=x*y;
        if(a==b)
        cc[t][0]=0;
        else if(a>b)
        cc[t][0]=1;
        else
        cc[t][0]=-1;
        if(a==c)
        cc[t][1]=0;
        else if(a>c)
        cc[t][1]=1;
        else
        cc[t][1]=-1;
        chk[{cc[t][0],cc[t][1]}]++;
        t++;
      }
      if(chk[{0,0}]){
        cout<<1<<'\n';
        continue;
      }
      bool ans=0;
      for(int i=-1;i<2;i++){
        for(int j=-1;j<2;j++)
        if(chk[{i,j}]&&chk[{-i,-j}])
        ans=1;
      }
      if(ans)
      cout<<2<<'\n';
      else
      cout<<0<<'\n';
    }
  }
  return 0;
}
/*

*/  
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -