답안 #999085

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
999085 2024-06-15T06:23:13 Z AdamGS Broken Device (JOI17_broken_device) C++17
59 / 100
33 ms 2648 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)]);
  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;
  }
  return x;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 31 ms 2480 KB Output is partially correct - L* = 30
2 Partially correct 25 ms 2400 KB Output is partially correct - L* = 28
3 Partially correct 26 ms 2396 KB Output is partially correct - L* = 31
4 Partially correct 32 ms 2388 KB Output is partially correct - L* = 27
5 Partially correct 26 ms 2404 KB Output is partially correct - L* = 29
6 Partially correct 26 ms 2396 KB Output is partially correct - L* = 32
7 Partially correct 26 ms 2396 KB Output is partially correct - L* = 35
8 Partially correct 27 ms 2612 KB Output is partially correct - L* = 32
9 Partially correct 26 ms 2484 KB Output is partially correct - L* = 28
10 Partially correct 31 ms 2400 KB Output is partially correct - L* = 36
11 Partially correct 26 ms 2396 KB Output is partially correct - L* = 32
12 Partially correct 26 ms 2516 KB Output is partially correct - L* = 33
13 Partially correct 26 ms 2404 KB Output is partially correct - L* = 33
14 Partially correct 25 ms 2648 KB Output is partially correct - L* = 28
15 Partially correct 26 ms 2396 KB Output is partially correct - L* = 34
16 Partially correct 27 ms 2392 KB Output is partially correct - L* = 32
17 Partially correct 26 ms 2308 KB Output is partially correct - L* = 30
18 Partially correct 26 ms 2592 KB Output is partially correct - L* = 28
19 Partially correct 26 ms 2400 KB Output is partially correct - L* = 31
20 Partially correct 26 ms 2488 KB Output is partially correct - L* = 35
21 Partially correct 28 ms 2396 KB Output is partially correct - L* = 32
22 Partially correct 26 ms 2392 KB Output is partially correct - L* = 24
23 Partially correct 28 ms 2396 KB Output is partially correct - L* = 25
24 Partially correct 26 ms 2392 KB Output is partially correct - L* = 32
25 Partially correct 26 ms 2372 KB Output is partially correct - L* = 25
26 Partially correct 26 ms 2396 KB Output is partially correct - L* = 31
27 Partially correct 31 ms 2408 KB Output is partially correct - L* = 35
28 Partially correct 26 ms 2372 KB Output is partially correct - L* = 26
29 Partially correct 33 ms 2372 KB Output is partially correct - L* = 33
30 Partially correct 30 ms 2544 KB Output is partially correct - L* = 28
31 Partially correct 31 ms 2388 KB Output is partially correct - L* = 34
32 Partially correct 25 ms 2572 KB Output is partially correct - L* = 33
33 Partially correct 27 ms 2388 KB Output is partially correct - L* = 34
34 Partially correct 26 ms 2396 KB Output is partially correct - L* = 30
35 Partially correct 25 ms 2468 KB Output is partially correct - L* = 32
36 Partially correct 26 ms 2400 KB Output is partially correct - L* = 26
37 Partially correct 28 ms 2484 KB Output is partially correct - L* = 28
38 Partially correct 28 ms 2400 KB Output is partially correct - L* = 34
39 Partially correct 25 ms 2388 KB Output is partially correct - L* = 31
40 Partially correct 26 ms 2400 KB Output is partially correct - L* = 29