This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define pii pair<int,int>
#define all(a) a.begin(),a.end()
#define S second
#define sz(a) (int)a.size()
#define rep(i , a , b) for(int i = (a) ; i <= (b) ; i++)
#define per(i , a , b) for(int i = (a) ; i >= (b) ; i--)
#define int long long
#define ld long double
using namespace std ;
const int maxn = 5e5 + 200 , maxq = 2e6+10 , mod = 1e9 + 7 , mod2 = 1e9 + 7, inf = 1e9 ;
signed main(){
ios_base::sync_with_stdio(false) ; cin.tie(0) ;
int T , n ;
ld p ;
cin >> n >> p >> T ;
while(T--){
string ans ;
rep(i , 1, n){
string s ;
rep(j ,1 ,n){
if(j==i)s += '1';
else s += '0' ;
}
cout << "Q " << s << endl ;
char a ;
cin >> a;
if(a=='P'){
ans+='1';
}else{
ans+='0';
}
}
cout << "A " << ans << endl ;
char x ;
cin >> x ;
if(x=='W')exit(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... |