Submission #1070215

# Submission time Handle Problem Language Result Execution time Memory
1070215 2024-08-22T12:18:08 Z AdamGS Brperm (RMI20_brperm) C++17
50 / 100
3000 ms 1628 KB
    #include "brperm.h"
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    #define rep(a, b) for(int a = 0; a < (b); ++a)
    #define st first
    #define nd second
    #define pb push_back
    #define all(a) a.begin(), a.end()
    const int LIM=5e5+7;
    char T[LIM];
int n;
    void init(int _n, const char s[]) {
    	n=_n;
      rep(i, n) T[i]=s[i];
    }
    int odw(int x, int k) {
    	int y=0;
    	rep(i, k) if(x&(1<<i)) y+=1<<(k-i-1);
    	return y;
    }
    int query(int i, int k) {
      if(i+(1<<k)>n) return 0;
    	rep(j, 1<<k) if(T[i+j]!=T[i+odw(j, k)]) return 0;
    	return 1;
    }
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 20 ms 1628 KB Output is correct
4 Correct 27 ms 1628 KB Output is correct
5 Correct 18 ms 1624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3012 ms 1616 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 20 ms 1628 KB Output is correct
4 Correct 27 ms 1628 KB Output is correct
5 Correct 18 ms 1624 KB Output is correct
6 Execution timed out 3012 ms 1616 KB Time limit exceeded
7 Halted 0 ms 0 KB -