Submission #924192

# Submission time Handle Problem Language Result Execution time Memory
924192 2024-02-08T16:03:23 Z Camillus Brperm (RMI20_brperm) C++17
0 / 100
2 ms 3164 KB
#include "bits/stdc++.h"
#define debug(...) 42
using namespace std;

#ifndef LOCAL
#include "brperm.h"
#else
void init(int n, const char s[]);
int query(int i, int k);
#endif

string s;

void init(int N, const char S[]) {
    s = string(S, S + N);
}

int query(int i, int k) {
    for (int j = 0; j < (1 << k); j++) {
        auto t = bitset<32>(j).to_string();
        reverse(t.begin(), t.end());
        swap(t[0], t[k - 1]);
        reverse(t.begin(), t.end());
        int k = bitset<32>(t).to_ulong();

        debug(j, k);
        debug(s);
        debug(i + j);
        debug(i + k);
        debug(s[i + j], s[i + k]);

        if (s[i + j] != s[i + k]) {
            return false;
        }
    }
    return true;
}

#ifdef LOCAL
char __s[(int)5e5 + 10] = {};

int main() {
    cin >> __s;
    init(strlen(__s), __s);

    int __x, __y;
    while (cin >> __x >> __y)
        cout << query(__x, __y) << '\n';

    return 0;
}
#endif

Compilation message

brperm.cpp: In function 'int query(int, int)':
brperm.cpp:2:20: warning: statement has no effect [-Wunused-value]
    2 | #define debug(...) 42
      |                    ^~
brperm.cpp:26:9: note: in expansion of macro 'debug'
   26 |         debug(j, k);
      |         ^~~~~
brperm.cpp:2:20: warning: statement has no effect [-Wunused-value]
    2 | #define debug(...) 42
      |                    ^~
brperm.cpp:27:9: note: in expansion of macro 'debug'
   27 |         debug(s);
      |         ^~~~~
brperm.cpp:2:20: warning: statement has no effect [-Wunused-value]
    2 | #define debug(...) 42
      |                    ^~
brperm.cpp:28:9: note: in expansion of macro 'debug'
   28 |         debug(i + j);
      |         ^~~~~
brperm.cpp:2:20: warning: statement has no effect [-Wunused-value]
    2 | #define debug(...) 42
      |                    ^~
brperm.cpp:29:9: note: in expansion of macro 'debug'
   29 |         debug(i + k);
      |         ^~~~~
brperm.cpp:2:20: warning: statement has no effect [-Wunused-value]
    2 | #define debug(...) 42
      |                    ^~
brperm.cpp:30:9: note: in expansion of macro 'debug'
   30 |         debug(s[i + j], s[i + k]);
      |         ^~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 3164 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -