Submission #999083

# Submission time Handle Problem Language Result Execution time Memory
999083 2024-06-15T06:21:46 Z AdamGS Broken Device (JOI17_broken_device) C++17
85 / 100
34 ms 2572 KB
#include "Annalib.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()
void Anna(int n, ll x, int k, int P[]) {
  mt19937 rng(2137);
  vector<int>S(n);
  rep(i, n) S[i]=i;
  rep(i, n) swap(S[i], S[rng()%(i+1)]);
  rep(i, 60) if(rng()&1) x^=1ll<<(ll)i;
  vector<int>czy(n), T(n);
  rep(i, k) czy[P[i]]=1;
  ll akt=0;
  rep(i, 60) {
    ll a=0;
    if(x&(1ll<<(ll)i)) a=1;
    while(akt<n && (akt%2!=a || czy[S[akt]])) ++akt;
    if(akt==n) break;
    T[S[akt]]=1;
    ++akt;
  }
  rep(i, n) Set(i, T[i]);
}
#include "Brunolib.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()
ll Bruno(int n, int A[]) {
  mt19937 rng(2137);
  vector<int>S(n);
  rep(i, n) S[i]=i;
  rep(i, n) swap(S[i], S[rng()%(i+1)]);
  ll x=0, p=0;
  rep(i, n) if(A[S[i]]) {
    if(i%2==1) x|=1ll<<(ll)p;
    ++p;
  }
  rep(i, 60) if(rng()&1) x^=1ll<<(ll)i;
  return x;
}
# Verdict Execution time Memory Grader output
1 Partially correct 26 ms 2372 KB Output is partially correct - L* = 37
2 Partially correct 27 ms 2372 KB Output is partially correct - L* = 37
3 Partially correct 27 ms 2512 KB Output is partially correct - L* = 38
4 Partially correct 28 ms 2404 KB Output is partially correct - L* = 38
5 Partially correct 28 ms 2404 KB Output is partially correct - L* = 39
6 Partially correct 27 ms 2396 KB Output is partially correct - L* = 39
7 Partially correct 28 ms 2396 KB Output is partially correct - L* = 37
8 Partially correct 27 ms 2476 KB Output is partially correct - L* = 38
9 Correct 27 ms 2572 KB Output is correct - L* = 40
10 Partially correct 26 ms 2376 KB Output is partially correct - L* = 39
11 Partially correct 28 ms 2432 KB Output is partially correct - L* = 38
12 Partially correct 29 ms 2480 KB Output is partially correct - L* = 39
13 Partially correct 27 ms 2392 KB Output is partially correct - L* = 39
14 Partially correct 34 ms 2308 KB Output is partially correct - L* = 39
15 Partially correct 27 ms 2372 KB Output is partially correct - L* = 38
16 Partially correct 27 ms 2544 KB Output is partially correct - L* = 37
17 Correct 27 ms 2484 KB Output is correct - L* = 40
18 Correct 27 ms 2408 KB Output is correct - L* = 40
19 Partially correct 27 ms 2384 KB Output is partially correct - L* = 38
20 Partially correct 27 ms 2396 KB Output is partially correct - L* = 38
21 Partially correct 27 ms 2476 KB Output is partially correct - L* = 38
22 Correct 27 ms 2404 KB Output is correct - L* = 40
23 Partially correct 27 ms 2484 KB Output is partially correct - L* = 39
24 Partially correct 28 ms 2528 KB Output is partially correct - L* = 39
25 Partially correct 27 ms 2480 KB Output is partially correct - L* = 39
26 Correct 27 ms 2396 KB Output is correct - L* = 40
27 Correct 28 ms 2396 KB Output is correct - L* = 40
28 Partially correct 27 ms 2388 KB Output is partially correct - L* = 39
29 Partially correct 32 ms 2460 KB Output is partially correct - L* = 39
30 Partially correct 27 ms 2404 KB Output is partially correct - L* = 37
31 Partially correct 27 ms 2404 KB Output is partially correct - L* = 39
32 Partially correct 27 ms 2372 KB Output is partially correct - L* = 38
33 Partially correct 27 ms 2400 KB Output is partially correct - L* = 38
34 Partially correct 27 ms 2476 KB Output is partially correct - L* = 37
35 Partially correct 27 ms 2396 KB Output is partially correct - L* = 38
36 Partially correct 27 ms 2384 KB Output is partially correct - L* = 39
37 Partially correct 27 ms 2372 KB Output is partially correct - L* = 38
38 Partially correct 27 ms 2516 KB Output is partially correct - L* = 37
39 Partially correct 27 ms 2372 KB Output is partially correct - L* = 38
40 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37