답안 #852157

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
852157 2023-09-21T10:30:53 Z Rafi22 Broken Device (JOI17_broken_device) C++14
85 / 100
38 ms 2820 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(213769);
    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(213769);
    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 38 ms 2488 KB Output is partially correct - L* = 39
2 Partially correct 32 ms 2648 KB Output is partially correct - L* = 38
3 Partially correct 34 ms 2564 KB Output is partially correct - L* = 37
4 Partially correct 36 ms 2820 KB Output is partially correct - L* = 38
5 Partially correct 32 ms 2460 KB Output is partially correct - L* = 38
6 Partially correct 33 ms 2396 KB Output is partially correct - L* = 39
7 Partially correct 33 ms 2592 KB Output is partially correct - L* = 37
8 Partially correct 34 ms 2304 KB Output is partially correct - L* = 39
9 Partially correct 33 ms 2404 KB Output is partially correct - L* = 38
10 Partially correct 32 ms 2648 KB Output is partially correct - L* = 37
11 Partially correct 31 ms 2396 KB Output is partially correct - L* = 38
12 Partially correct 33 ms 2464 KB Output is partially correct - L* = 37
13 Partially correct 32 ms 2400 KB Output is partially correct - L* = 38
14 Partially correct 33 ms 2312 KB Output is partially correct - L* = 38
15 Partially correct 32 ms 2304 KB Output is partially correct - L* = 39
16 Partially correct 32 ms 2304 KB Output is partially correct - L* = 38
17 Partially correct 33 ms 2484 KB Output is partially correct - L* = 37
18 Partially correct 32 ms 2392 KB Output is partially correct - L* = 39
19 Partially correct 31 ms 2648 KB Output is partially correct - L* = 37
20 Partially correct 31 ms 2400 KB Output is partially correct - L* = 38
21 Partially correct 31 ms 2304 KB Output is partially correct - L* = 38
22 Partially correct 32 ms 2396 KB Output is partially correct - L* = 37
23 Partially correct 31 ms 2392 KB Output is partially correct - L* = 39
24 Partially correct 31 ms 2396 KB Output is partially correct - L* = 38
25 Partially correct 34 ms 2480 KB Output is partially correct - L* = 37
26 Partially correct 31 ms 2392 KB Output is partially correct - L* = 38
27 Partially correct 32 ms 2400 KB Output is partially correct - L* = 37
28 Partially correct 32 ms 2304 KB Output is partially correct - L* = 37
29 Partially correct 32 ms 2304 KB Output is partially correct - L* = 39
30 Partially correct 32 ms 2588 KB Output is partially correct - L* = 38
31 Partially correct 32 ms 2392 KB Output is partially correct - L* = 38
32 Partially correct 33 ms 2704 KB Output is partially correct - L* = 37
33 Partially correct 32 ms 2332 KB Output is partially correct - L* = 37
34 Partially correct 34 ms 2400 KB Output is partially correct - L* = 37
35 Partially correct 31 ms 2372 KB Output is partially correct - L* = 38
36 Partially correct 32 ms 2412 KB Output is partially correct - L* = 38
37 Partially correct 31 ms 2392 KB Output is partially correct - L* = 37
38 Partially correct 32 ms 2648 KB Output is partially correct - L* = 37
39 Partially correct 35 ms 2564 KB Output is partially correct - L* = 39
40 Partially correct 33 ms 2372 KB Output is partially correct - L* = 38