Submission #1191000

#TimeUsernameProblemLanguageResultExecution timeMemory
1191000Math4Life2020Red-blue table (IZhO19_stones)C++20
Compilation error
0 ms0 KiB
           for (ll b1 = 0; b1<M; b1++) {
                        isa[a1][b1]=0;
                }
        }
        for (ll a1=0;a1<ac;a1++) {
                for (ll b1=0; b1<M; b1++) { //now switch the center chunk to be Bs if necessary
                        isa[a1][b1]=1;
                }
        }
        set<ll> s0;
        for (ll b1=0;b1<bc;b1++) {
                ll nb = max(0LL,N/2+1-(N-ac));
                for (ll t=0;t<nb;t++) {
                        if (s0.size()==0) {
                                for (ll a1=0;a1<ac;a1++) {
                                        s0.insert(a1);
                                }
                        }
                        assert(!s0.empty());
                        ll x0 = *s0.begin(); s0.erase(s0.begin());
                        isa[x0][b1]=0;
                }
        }
        for (ll a1=0;a1<N;a1++) {
                for (ll b1=0;b1<M;b1++) {
                        cout << (isa[a1][b1] ? "+" : "-");
                }
                cout << "\n";
        }
}

int main() {
        ios_base::sync_with_stdio(false); cin.tie(0);
        ll T; cin >> T;
        while (T--) solve();
}

Compilation message (stderr)

stones.cpp:1:12: error: expected unqualified-id before 'for'
    1 |            for (ll b1 = 0; b1<M; b1++) {
      |            ^~~
stones.cpp:1:31: error: 'M' was not declared in this scope
    1 |            for (ll b1 = 0; b1<M; b1++) {
      |                               ^
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:31: error: 'M' was not declared in this scope
stones.cpp:1:28: error: 'b1' does not name a type
    1 |            for (ll b1 = 0; b1<M; b1++) {
      |                            ^~
stones.cpp:1:34: error: 'b1' does not name a type
    1 |            for (ll b1 = 0; b1<M; b1++) {
      |                                  ^~
stones.cpp:4:9: error: expected declaration before '}' token
    4 |         }
      |         ^
stones.cpp:5:9: error: expected unqualified-id before 'for'
    5 |         for (ll a1=0;a1<ac;a1++) {
      |         ^~~
stones.cpp:5:25: error: 'ac' was not declared in this scope
    5 |         for (ll a1=0;a1<ac;a1++) {
      |                         ^~
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:25: error: 'ac' was not declared in this scope
stones.cpp:5:22: error: 'a1' does not name a type
    5 |         for (ll a1=0;a1<ac;a1++) {
      |                      ^~
stones.cpp:5:28: error: 'a1' does not name a type
    5 |         for (ll a1=0;a1<ac;a1++) {
      |                            ^~
stones.cpp:10:13: error: 'll' was not declared in this scope
   10 |         set<ll> s0;
      |             ^~
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:13: error: 'll' was not declared in this scope
stones.cpp:10:9: error: 'set' does not name a type
   10 |         set<ll> s0;
      |         ^~~
stones.cpp:11:9: error: expected unqualified-id before 'for'
   11 |         for (ll b1=0;b1<bc;b1++) {
      |         ^~~
stones.cpp:11:25: error: 'bc' was not declared in this scope
   11 |         for (ll b1=0;b1<bc;b1++) {
      |                         ^~
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:25: error: 'bc' was not declared in this scope
stones.cpp:11:22: error: 'b1' does not name a type
   11 |         for (ll b1=0;b1<bc;b1++) {
      |                      ^~
stones.cpp:11:28: error: 'b1' does not name a type
   11 |         for (ll b1=0;b1<bc;b1++) {
      |                            ^~
stones.cpp:24:9: error: expected unqualified-id before 'for'
   24 |         for (ll a1=0;a1<N;a1++) {
      |         ^~~
stones.cpp:24:25: error: 'N' was not declared in this scope
   24 |         for (ll a1=0;a1<N;a1++) {
      |                         ^
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:25: error: 'N' was not declared in this scope
stones.cpp:24:22: error: 'a1' does not name a type
   24 |         for (ll a1=0;a1<N;a1++) {
      |                      ^~
stones.cpp:24:27: error: 'a1' does not name a type
   24 |         for (ll a1=0;a1<N;a1++) {
      |                           ^~
stones.cpp:30:1: error: expected declaration before '}' token
   30 | }
      | ^
stones.cpp: In function 'int main()':
stones.cpp:33:9: error: 'ios_base' has not been declared
   33 |         ios_base::sync_with_stdio(false); cin.tie(0);
      |         ^~~~~~~~
stones.cpp:33:43: error: 'cin' was not declared in this scope
   33 |         ios_base::sync_with_stdio(false); cin.tie(0);
      |                                           ^~~
stones.cpp:34:9: error: 'll' was not declared in this scope
   34 |         ll T; cin >> T;
      |         ^~
stones.cpp:34:22: error: 'T' was not declared in this scope
   34 |         ll T; cin >> T;
      |                      ^
stones.cpp:35:21: error: 'solve' was not declared in this scope
   35 |         while (T--) solve();
      |                     ^~~~~