답안 #999090

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
999090 2024-06-15T06:27:17 Z AdamGS Broken Device (JOI17_broken_device) C++17
79 / 100
35 ms 2908 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=x%3; x/=3;
    while(akt<n && (akt%3!=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=1;
  rep(i, n) if(A[S[i]]) {
    x+=p*(ll)(i%3);
    p*=3;
  }
  rep(i, 60) if(rng()&1) x^=1ll<<(ll)i;
  return x;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 33 ms 2392 KB Output is partially correct - L* = 37
2 Partially correct 26 ms 2400 KB Output is partially correct - L* = 39
3 Correct 26 ms 2396 KB Output is correct - L* = 40
4 Correct 27 ms 2544 KB Output is correct - L* = 40
5 Partially correct 26 ms 2476 KB Output is partially correct - L* = 36
6 Partially correct 27 ms 2432 KB Output is partially correct - L* = 37
7 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
8 Partially correct 31 ms 2440 KB Output is partially correct - L* = 34
9 Correct 28 ms 2396 KB Output is correct - L* = 40
10 Partially correct 26 ms 2372 KB Output is partially correct - L* = 38
11 Partially correct 28 ms 2652 KB Output is partially correct - L* = 38
12 Partially correct 26 ms 2396 KB Output is partially correct - L* = 38
13 Partially correct 26 ms 2488 KB Output is partially correct - L* = 38
14 Partially correct 26 ms 2476 KB Output is partially correct - L* = 38
15 Partially correct 26 ms 2392 KB Output is partially correct - L* = 37
16 Correct 28 ms 2484 KB Output is correct - L* = 40
17 Correct 35 ms 2448 KB Output is correct - L* = 40
18 Correct 27 ms 2396 KB Output is correct - L* = 40
19 Partially correct 27 ms 2388 KB Output is partially correct - L* = 38
20 Partially correct 28 ms 2476 KB Output is partially correct - L* = 38
21 Partially correct 26 ms 2492 KB Output is partially correct - L* = 38
22 Partially correct 27 ms 2404 KB Output is partially correct - L* = 39
23 Partially correct 31 ms 2396 KB Output is partially correct - L* = 37
24 Partially correct 28 ms 2596 KB Output is partially correct - L* = 38
25 Partially correct 26 ms 2484 KB Output is partially correct - L* = 37
26 Partially correct 26 ms 2400 KB Output is partially correct - L* = 38
27 Partially correct 26 ms 2396 KB Output is partially correct - L* = 37
28 Correct 26 ms 2396 KB Output is correct - L* = 40
29 Partially correct 26 ms 2400 KB Output is partially correct - L* = 39
30 Partially correct 25 ms 2900 KB Output is partially correct - L* = 37
31 Partially correct 26 ms 2392 KB Output is partially correct - L* = 39
32 Correct 28 ms 2908 KB Output is correct - L* = 40
33 Partially correct 26 ms 2476 KB Output is partially correct - L* = 38
34 Correct 27 ms 2404 KB Output is correct - L* = 40
35 Partially correct 26 ms 2372 KB Output is partially correct - L* = 39
36 Partially correct 26 ms 2500 KB Output is partially correct - L* = 39
37 Partially correct 25 ms 2404 KB Output is partially correct - L* = 37
38 Partially correct 26 ms 2372 KB Output is partially correct - L* = 38
39 Partially correct 26 ms 2404 KB Output is partially correct - L* = 39
40 Correct 27 ms 2372 KB Output is correct - L* = 40