답안 #363361

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
363361 2021-02-05T17:49:15 Z denkendoemeer Broken Device (JOI17_broken_device) C++14
0 / 100
67 ms 3124 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(0);
    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 || num.first==0) && (poz[aux[i+1]]==0 && num.second==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(0);
    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 52 ms 2936 KB Output isn't correct - L* = 0
2 Partially correct 49 ms 3000 KB Output isn't correct - L* = 0
3 Partially correct 52 ms 2948 KB Output isn't correct - L* = 0
4 Partially correct 54 ms 2868 KB Output isn't correct - L* = 0
5 Partially correct 49 ms 2948 KB Output isn't correct - L* = 0
6 Partially correct 54 ms 2892 KB Output isn't correct - L* = 0
7 Partially correct 59 ms 2744 KB Output isn't correct - L* = 0
8 Partially correct 50 ms 2948 KB Output isn't correct - L* = 0
9 Partially correct 61 ms 2872 KB Output isn't correct - L* = 0
10 Partially correct 49 ms 2744 KB Output isn't correct - L* = 0
11 Partially correct 56 ms 2872 KB Output isn't correct - L* = 0
12 Partially correct 49 ms 2744 KB Output isn't correct - L* = 0
13 Partially correct 49 ms 2948 KB Output isn't correct - L* = 0
14 Partially correct 67 ms 2948 KB Output isn't correct - L* = 0
15 Partially correct 56 ms 2832 KB Output isn't correct - L* = 0
16 Partially correct 49 ms 2872 KB Output isn't correct - L* = 0
17 Partially correct 49 ms 2740 KB Output isn't correct - L* = 0
18 Partially correct 56 ms 2948 KB Output isn't correct - L* = 0
19 Partially correct 49 ms 2744 KB Output isn't correct - L* = 0
20 Partially correct 49 ms 2948 KB Output isn't correct - L* = 0
21 Partially correct 56 ms 2968 KB Output isn't correct - L* = 0
22 Partially correct 49 ms 2948 KB Output isn't correct - L* = 0
23 Partially correct 50 ms 2872 KB Output isn't correct - L* = 0
24 Partially correct 59 ms 2744 KB Output isn't correct - L* = 0
25 Partially correct 49 ms 2948 KB Output isn't correct - L* = 0
26 Partially correct 55 ms 2744 KB Output isn't correct - L* = 0
27 Partially correct 63 ms 2948 KB Output isn't correct - L* = 0
28 Partially correct 55 ms 3124 KB Output isn't correct - L* = 0
29 Partially correct 49 ms 3028 KB Output isn't correct - L* = 0
30 Partially correct 56 ms 3076 KB Output isn't correct - L* = 0
31 Partially correct 50 ms 2964 KB Output isn't correct - L* = 0
32 Partially correct 50 ms 2744 KB Output isn't correct - L* = 0
33 Partially correct 60 ms 2948 KB Output isn't correct - L* = 0
34 Partially correct 53 ms 2912 KB Output isn't correct - L* = 0
35 Partially correct 50 ms 2872 KB Output isn't correct - L* = 0
36 Partially correct 49 ms 2872 KB Output isn't correct - L* = 0
37 Partially correct 49 ms 3104 KB Output isn't correct - L* = 0
38 Partially correct 49 ms 2948 KB Output isn't correct - L* = 0
39 Partially correct 53 ms 3048 KB Output isn't correct - L* = 0
40 Partially correct 49 ms 2956 KB Output isn't correct - L* = 0