답안 #852156

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
852156 2023-09-21T10:28:29 Z Rafi22 Broken Device (JOI17_broken_device) C++14
85 / 100
53 ms 2744 KB
#include <bits/stdc++.h>
#include "Annalib.h"

#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;
//int inf=1000000007;
//int mod=1000000007;
//int mod1=998244353;

bool bad[157];
int res[157];

void Anna(int n,ll x,int k,int P[])
{
    srand(2137);
    vector<int>ord;
    for(int i=0;i<150;i++) ord.pb(i);
    random_shuffle(all(ord));
    for(int i=0;i<150;i++)
    {
        res[i]=0;
        bad[i]=0;
    }
    for(int i=0;i<k;i++) bad[P[i]]=1;
    for(int i=0;i<150;i+=2)
    {
        if(bad[ord[i]]||bad[ord[i+1]]) continue;
        if(x%3==0||x%3==2) res[ord[i]]=1;
        if(x%3==1||x%3==2) res[ord[i+1]]=1;
        x/=3;
    }
    for(int i=0;i<150;i++) Set(i,res[i]);
}
#include <bits/stdc++.h>
#include "Brunolib.h"

#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;
//int inf=1000000007;
//int mod=1000000007;
//int mod1=998244353;

ll Bruno(int n,int a[])
{
    srand(2137);
    vector<int>ord;
    for(int i=0;i<150;i++) ord.pb(i);
    random_shuffle(all(ord));
    ll wyn=0,p=1;
    for(int i=0;i<150;i+=2)
    {
        if(a[ord[i]]==0&&a[ord[i+1]]==0) continue;
        if(a[ord[i]]==0&&a[ord[i+1]]==1) wyn+=p;
        if(a[ord[i]]==1&&a[ord[i+1]]==1) wyn+=2*p;
        p*=3;
    }
    return wyn;
}

# 결과 실행 시간 메모리 Grader output
1 Partially correct 37 ms 2476 KB Output is partially correct - L* = 38
2 Partially correct 31 ms 2392 KB Output is partially correct - L* = 39
3 Partially correct 35 ms 2564 KB Output is partially correct - L* = 39
4 Partially correct 34 ms 2404 KB Output is partially correct - L* = 38
5 Partially correct 41 ms 2304 KB Output is partially correct - L* = 38
6 Partially correct 40 ms 2364 KB Output is partially correct - L* = 39
7 Partially correct 38 ms 2560 KB Output is partially correct - L* = 39
8 Partially correct 38 ms 2332 KB Output is partially correct - L* = 39
9 Partially correct 33 ms 2652 KB Output is partially correct - L* = 38
10 Partially correct 32 ms 2328 KB Output is partially correct - L* = 39
11 Partially correct 32 ms 2392 KB Output is partially correct - L* = 37
12 Partially correct 53 ms 2304 KB Output is partially correct - L* = 39
13 Partially correct 32 ms 2404 KB Output is partially correct - L* = 39
14 Partially correct 32 ms 2404 KB Output is partially correct - L* = 39
15 Partially correct 32 ms 2648 KB Output is partially correct - L* = 38
16 Partially correct 35 ms 2324 KB Output is partially correct - L* = 38
17 Partially correct 31 ms 2340 KB Output is partially correct - L* = 39
18 Partially correct 32 ms 2372 KB Output is partially correct - L* = 39
19 Partially correct 32 ms 2320 KB Output is partially correct - L* = 38
20 Partially correct 32 ms 2304 KB Output is partially correct - L* = 38
21 Partially correct 37 ms 2744 KB Output is partially correct - L* = 39
22 Partially correct 33 ms 2360 KB Output is partially correct - L* = 38
23 Partially correct 32 ms 2652 KB Output is partially correct - L* = 39
24 Partially correct 32 ms 2400 KB Output is partially correct - L* = 39
25 Partially correct 32 ms 2396 KB Output is partially correct - L* = 39
26 Partially correct 32 ms 2400 KB Output is partially correct - L* = 38
27 Partially correct 32 ms 2404 KB Output is partially correct - L* = 39
28 Partially correct 34 ms 2304 KB Output is partially correct - L* = 39
29 Partially correct 33 ms 2304 KB Output is partially correct - L* = 39
30 Partially correct 32 ms 2304 KB Output is partially correct - L* = 39
31 Partially correct 33 ms 2340 KB Output is partially correct - L* = 38
32 Partially correct 33 ms 2400 KB Output is partially correct - L* = 38
33 Partially correct 32 ms 2348 KB Output is partially correct - L* = 39
34 Partially correct 32 ms 2308 KB Output is partially correct - L* = 38
35 Partially correct 32 ms 2304 KB Output is partially correct - L* = 39
36 Partially correct 31 ms 2612 KB Output is partially correct - L* = 39
37 Partially correct 32 ms 2340 KB Output is partially correct - L* = 38
38 Partially correct 35 ms 2404 KB Output is partially correct - L* = 38
39 Partially correct 32 ms 2588 KB Output is partially correct - L* = 39
40 Partially correct 32 ms 2304 KB Output is partially correct - L* = 39