답안 #378358

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
378358 2021-03-16T14:32:57 Z EIMONIM Broken Device (JOI17_broken_device) C++14
85 / 100
66 ms 2864 KB
#include <bits/stdc++.h>
#define ll long long
#include "Annalib.h"
using namespace std;
pair<int,int>val(int x)
{
    if (x==0)
        return {0,1};
    if (x==1)
        return {1,0};
    return {1,1};
}
void Anna(int n,ll x,int k,int p[])
{
    srand(42);
    vector<int>aux(n);
    int i;
    for(i=0;i<n;i++)
        aux[i]=i;
    random_shuffle(aux.begin(),aux.end());
    vector<bool>poz(n,0),ans(n);
    for(i=0;i<k;i++)
        poz[p[i]]=1;
    for(i=0;i<n;i+=2){
        auto num=val(x%3);
        if ((poz[aux[i]]==0 ) && (poz[aux[i+1]]==0 )){
            ans[aux[i]]=num.first;
            ans[aux[i+1]]=num.second;
            x=x/3;
        }
    }
    for(i=0;i<n;i++)
        Set(i,ans[i]);
}
#include<bits/stdc++.h>
#define ll long long
#include "Brunolib.h"
using namespace std;
int val(pair<int,int>num)
{
    if (num.first+num.second==2)
        return 2;
    return num.first;
}
ll Bruno(int n,int a[])
{
    srand(42);
    vector<int>aux(n);
    int i;
    for(i=0;i<n;i++)
        aux[i]=i;
    random_shuffle(aux.begin(),aux.end());
    ll ans=0,po=1;
    for(i=0;i<n;i+=2){
        if (a[aux[i]] || a[aux[i+1]]){
            ans=ans+po*val({a[aux[i]],a[aux[i+1]]});
            po=po*3;
        }
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 50 ms 2492 KB Output is partially correct - L* = 37
2 Partially correct 51 ms 2864 KB Output is partially correct - L* = 38
3 Partially correct 50 ms 2668 KB Output is partially correct - L* = 38
4 Partially correct 55 ms 2692 KB Output is partially correct - L* = 37
5 Partially correct 51 ms 2620 KB Output is partially correct - L* = 37
6 Partially correct 52 ms 2492 KB Output is partially correct - L* = 38
7 Partially correct 51 ms 2692 KB Output is partially correct - L* = 38
8 Partially correct 53 ms 2612 KB Output is partially correct - L* = 38
9 Partially correct 59 ms 2620 KB Output is partially correct - L* = 37
10 Partially correct 53 ms 2620 KB Output is partially correct - L* = 38
11 Partially correct 52 ms 2692 KB Output is partially correct - L* = 38
12 Partially correct 50 ms 2492 KB Output is partially correct - L* = 38
13 Partially correct 52 ms 2492 KB Output is partially correct - L* = 38
14 Partially correct 51 ms 2640 KB Output is partially correct - L* = 38
15 Partially correct 57 ms 2700 KB Output is partially correct - L* = 38
16 Partially correct 59 ms 2692 KB Output is partially correct - L* = 38
17 Partially correct 51 ms 2492 KB Output is partially correct - L* = 38
18 Partially correct 53 ms 2820 KB Output is partially correct - L* = 37
19 Partially correct 66 ms 2584 KB Output is partially correct - L* = 38
20 Partially correct 60 ms 2624 KB Output is partially correct - L* = 38
21 Partially correct 51 ms 2620 KB Output is partially correct - L* = 38
22 Partially correct 51 ms 2692 KB Output is partially correct - L* = 38
23 Partially correct 51 ms 2692 KB Output is partially correct - L* = 38
24 Partially correct 51 ms 2692 KB Output is partially correct - L* = 37
25 Partially correct 57 ms 2820 KB Output is partially correct - L* = 37
26 Partially correct 53 ms 2492 KB Output is partially correct - L* = 37
27 Partially correct 63 ms 2640 KB Output is partially correct - L* = 38
28 Partially correct 51 ms 2692 KB Output is partially correct - L* = 37
29 Partially correct 51 ms 2700 KB Output is partially correct - L* = 38
30 Partially correct 52 ms 2492 KB Output is partially correct - L* = 38
31 Partially correct 54 ms 2492 KB Output is partially correct - L* = 38
32 Partially correct 52 ms 2508 KB Output is partially correct - L* = 38
33 Partially correct 50 ms 2492 KB Output is partially correct - L* = 38
34 Partially correct 52 ms 2492 KB Output is partially correct - L* = 38
35 Partially correct 51 ms 2692 KB Output is partially correct - L* = 37
36 Partially correct 52 ms 2492 KB Output is partially correct - L* = 38
37 Partially correct 53 ms 2820 KB Output is partially correct - L* = 38
38 Partially correct 54 ms 2620 KB Output is partially correct - L* = 37
39 Partially correct 51 ms 2620 KB Output is partially correct - L* = 38
40 Partially correct 51 ms 2752 KB Output is partially correct - L* = 37