Submission #1075048

# Submission time Handle Problem Language Result Execution time Memory
1075048 2024-08-25T17:55:07 Z Ausp3x COVID tests (CEOI24_covid) C++17
10 / 100
2778 ms 344 KB
// 人外有人,天外有天
// author: Ausp3x

#pragma GCC optimize("O1, O2, O3, Ofast, unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
// #define DEBUG
typedef long long    lng;
typedef __int128     lli;
template<class T> 
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int const INF32 = 0x3f3f3f3f;
lng const INF64 = 0x3f3f3f3f3f3f3f3f;

int N;
double P;
bool test_students(vector<bool> &msk) {
    assert(msk.size() == N);

    string msk_str = "Q ";
    for (int i = 0; i < N; i++)
        msk_str += msk[i] ? '1' : '0';

    cout << msk_str << endl;

    char res;
    cin >> res;
    return res == 'P';
}

vector<bool> find_positive() {
    vector<bool> msk(N), ans(N);
    for (int i = 0; i < N; i++) {
        msk[i] = true;
        ans[i] = test_students(msk);
        msk[i] = false;
    }

    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int T;
    cin >> N >> P >> T;
    while (T--) {
        vector<bool> ans = find_positive();

        string ans_str = "A ";
        for (int i = 0; i < N; i++)
            ans_str += ans[i] ? '1' : '0';

        cout << ans_str << endl;

        char res;
        cin >> res;
        if (res == 'W')
            return 0;
    }

    return 0;
}

Compilation message

Main.cpp:4:55: warning: bad option '-f O2' to pragma 'optimize' [-Wpragmas]
    4 | #pragma GCC optimize("O1, O2, O3, Ofast, unroll-loops")
      |                                                       ^
Main.cpp:4:55: warning: bad option '-f O3' to pragma 'optimize' [-Wpragmas]
Main.cpp:4:55: warning: bad option '-f Ofast' to pragma 'optimize' [-Wpragmas]
Main.cpp:4:55: warning: bad option '-f unroll-loops' to pragma 'optimize' [-Wpragmas]
Main.cpp:24:37: warning: bad option '-f O2' to attribute 'optimize' [-Wattributes]
   24 | bool test_students(vector<bool> &msk) {
      |                                     ^
Main.cpp:24:37: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes]
Main.cpp:24:37: warning: bad option '-f Ofast' to attribute 'optimize' [-Wattributes]
Main.cpp:24:37: warning: bad option '-f unroll-loops' to attribute 'optimize' [-Wattributes]
In file included from /usr/include/c++/10/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp:45,
                 from /usr/include/c++/10/ext/pb_ds/detail/container_base_dispatch.hpp:90,
                 from /usr/include/c++/10/ext/pb_ds/assoc_container.hpp:48,
                 from Main.cpp:6:
Main.cpp: In function 'bool test_students(std::vector<bool>&)':
Main.cpp:25:23: warning: comparison of integer expressions of different signedness: 'std::vector<bool>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |     assert(msk.size() == N);
      |            ~~~~~~~~~~~^~~~
Main.cpp: At global scope:
Main.cpp:38:28: warning: bad option '-f O2' to attribute 'optimize' [-Wattributes]
   38 | vector<bool> find_positive() {
      |                            ^
Main.cpp:38:28: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes]
Main.cpp:38:28: warning: bad option '-f Ofast' to attribute 'optimize' [-Wattributes]
Main.cpp:38:28: warning: bad option '-f unroll-loops' to attribute 'optimize' [-Wattributes]
Main.cpp:49:10: warning: bad option '-f O2' to attribute 'optimize' [-Wattributes]
   49 | int main() {
      |          ^
Main.cpp:49:10: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes]
Main.cpp:49:10: warning: bad option '-f Ofast' to attribute 'optimize' [-Wattributes]
Main.cpp:49:10: warning: bad option '-f unroll-loops' to attribute 'optimize' [-Wattributes]
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 344 KB Output is correct
2 Correct 7 ms 344 KB Output is correct
3 Correct 7 ms 344 KB Output is correct
4 Correct 8 ms 344 KB Output is correct
5 Correct 7 ms 344 KB Output is correct
6 Correct 7 ms 344 KB Output is correct
7 Correct 7 ms 344 KB Output is correct
8 Correct 7 ms 344 KB Output is correct
9 Correct 7 ms 344 KB Output is correct
10 Correct 7 ms 344 KB Output is correct
11 Correct 7 ms 344 KB Output is correct
12 Correct 9 ms 344 KB Output is correct
13 Correct 7 ms 344 KB Output is correct
14 Correct 7 ms 344 KB Output is correct
15 Correct 7 ms 344 KB Output is correct
16 Correct 7 ms 344 KB Output is correct
17 Correct 7 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2778 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -