QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#528540 | #9162. COVID tests | Mispertion# | 0 | 264ms | 3976kb | C++23 | 2.2kb | 2024-08-23 16:01:31 | 2024-08-23 16:01:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
#define int ll
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mispertion ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define F first
#define S second
#define getlast(s) (*s.rbegin())
#define debg cout << "OK\n"
const ld PI = 3.1415926535;
const int N = 2e5 + 10;
const int M = 1e5 + 10;
int mod = 998244353;
const int infi = INT_MAX;
const ll infl = 1e16;
const int P = 2;
int mult(int a, int b){
return a * 1LL * b % mod;
}
int sum(int a, int b){
if(a + b >= mod)
return a + b - mod;
if(a + b < 0)
return a + b + mod;
return a + b;
}
int binpow(int a, int n){
if (n == 0)
return 1;
if (n % 2 == 1){
return mult(binpow(a, n - 1), a);
}
else{
auto b = binpow(a, n / 2);
return mult(b, b);
}
}
int n, ans[N];
double p;
int ask(string s){
cout << "Q " << s << endl;
char c;
cin >> c;
return (c == 'P');
}
int ask(int l, int r){
string s = "";
for(int i = 1; i <= n; i++){
if(i < l || i > r)
s += "0";
else
s += "1";
}
cout << "Q " << s << endl;
char c;
cin >> c;
return (c == 'P');
}
void solve(){
for(int i = 1; i <= n; i++)
ans[i] = 0;
int cur = 1;
while(cur < n){
int lo = cur - 1, hi = n + 1;
while(lo + 1 < hi){
int m = (lo + hi) / 2;
if(ask(cur, m))
hi = m;
else
lo = m;
}
ans[hi] = 1;
cur = hi + 1;
}
cout << "A ";
for(int i = 1; i <= n; i++)
cout << ans[i];
cout << endl;
char c;
cin >> c;
if(c == 'W')
exit(0);
}
signed main(){
mispertion;
int t = 1;
cin >> n >> p;
cin >> t;
while (t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 29ms
memory: 3784kb
input:
1000 0.789673 1 P P P P P P P P P P P P P P P P P N P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P N P P P P P P P P P P P P P P P P P P N P P P P P P P P P N P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P P ...
output:
Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.0 0.0 translate:wrong
Subtask #2:
score: 0
Wrong Answer
Test #18:
score: 50.15
Acceptable Answer
time: 39ms
memory: 3728kb
input:
1000 0.001 300 N N N N N N N N N N C N P N N P P P N N P N N N N N N N N N C N N P N P N P N P N P P N N N P N P P P N N N P N N N N N N N N C N N N N N N N N N N C N N N N N N N N N N C P N P N P N N N P P N N N N N N N N N N C N N P P P N N N N N N N N N N N N N C N N N N N N N N N N C N N N N N N...
output:
Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.55722222220 0.5572222222 Output is correct (P=0.001, F=15.1, Q=18.1) -> 50.15 points
Test #19:
score: 72.43
Acceptable Answer
time: 49ms
memory: 3884kb
input:
1000 0.005256 300 P P P N N P P P P P P P P P P P N P N N P N N P P P P N P P N P P N N P N N N N N N P P N N P N N N N N N N C N P P N N P N N P P N P N P P P P N N P N P N N N N N N N N N N N N C N N N P N P N N N P N N N N N N N C P P N P P N N N P N P P N P N N P P N N P P P P P P N P P N P N P ...
output:
Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.80477777780 0.8047777778 Output is correct (P=0.005256, F=51.1, Q=54.2) -> 72.43 points
Test #20:
score: 57.98
Acceptable Answer
time: 105ms
memory: 3896kb
input:
1000 0.011546 300 P P P P P N P P P N P P P P P P N P P N P P N N N P P P N P P P P N P N P N N P P P P P P P P P N P P P P P P P P N P P P P N P N P N P P P P P P P N N P N P N N P N P N N N P P N N N P N N N P P N P P N P N N N N N N N N N N C P P P N N P P N P P P N P P N P N P N N N P N N P P N ...
output:
Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.64422222220 0.6442222222 Output is correct (P=0.011546, F=94.9, Q=108.0) -> 57.98 points
Test #21:
score: 39.43
Acceptable Answer
time: 264ms
memory: 3736kb
input:
1000 0.028545 300 P P P P P P P P P P P P N P N P P P N P P P P N N N N N P P P P P P P P N P P P P N P N P N P N P P P P P P P N P P P P P N P P P N P P P N P P P P P P P P P P N P P P P P P P P P N P N N N P P P P P N P N N P P P P P N P P N P P P P P P P P P P P P P P P P N N P P P P P P P N P P ...
output:
Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.43811111110 0.4381111111 Output is correct (P=0.028545, F=191.5, Q=252.9) -> 39.43 points
Test #22:
score: 0
Wrong Answer
time: 68ms
memory: 3976kb
input:
1000 0.039856 300 P P P P P P N P N P P P P P P N P N P N P P P P P P P N P P P P N P P P P N P P P P P P P N N N N N P P P P P P P P N P P P P P P P P N N N P P P P P P N P P P P P P P P N P N P P P P P P P P N P P P P P N N P N P P P P P P N P N N P P P P P P N N P P P P P P P N N P P P P P P N P ...
output:
Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.0 0.0 translate:wrong