QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#528488#9162. COVID testsMispertion#0 3ms3792kbC++232.1kb2024-08-23 15:03:032024-08-23 15:03:03

Judging History

你现在查看的是最新测评结果

  • [2024-08-23 15:03:03]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:3792kb
  • [2024-08-23 15:03:03]
  • 提交

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');
}

void getans(int l, int r){
    cout << l << ' ' << r << '\n';
    string req = "";
    for(int i = 1; i < l; i++)
        req += "0";
    for(int i = 1; i <= r - l + 1; i++)
        req += "1";
    for(int i = 1; i <= n - r; i++){
        req += "0";
    }
    if(ask(req)){
        if(r - l == 0){
            ans[l] = 1;
            return;
        }
        int m = (l + r) / 2;
        getans(l, m);
        getans(m + 1, r);
    }
}

void solve(){
    for(int i = 1; i <= n; i++)
        ans[i] = 0;
    getans(1, n);
    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: 1ms
memory: 3792kb

input:

1000 0.789673 1

output:

1 1000
Q 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

wrong answer sn't correspond to pattern "(Q)|(A)"

Subtask #2:

score: 0
Wrong Answer

Test #18:

score: 0
Wrong Answer
time: 3ms
memory: 3740kb

input:

1000 0.001 300

output:

1 1000
Q 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

wrong answer sn't correspond to pattern "(Q)|(A)"