제출 #1130789

#제출 시각아이디문제언어결과실행 시간메모리
1130789jackofall718Experimental Charges (NOI19_charges)C++20
0 / 100
19 ms1092 KiB
//NOI 2019 Prelims problem 3
#include <bits/stdc++.h>
#define ll long long int
#define endl '\n'
#define vn vector <ll>
using namespace std;
const int MAX_N = 1e9 + 7;
#define pii pair <ll,ll>
const ll INF = 0x3f3f3f3f3f3f3f3f;

#define pb push_back  

#define srt(vp) sort(vp.begin(), vp.end()) 

int main() {
  ios::sync_with_stdio(false);        
  cin.tie(nullptr);
  int n,q;
  cin>>n>>q;
  vn v(n+1,MAX_N);
  while (q--){
    char a;
    ll b,c;
    cin>>a>>b>>c;
    ll d = max(c,b);
    if (a=='A')v[d]=0;
    if (a=='R')v[d]=1;
    else{
        if (v[d]==MAX_N)cout<<"?"<<endl;
        else{
            if (v[d]==0)cout<<"A"<<endl;
            else cout<<"R"<<endl;
        }
    }

  }

   
}
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...