Submission #852151

# Submission time Handle Problem Language Result Execution time Memory
852151 2023-09-21T10:24:25 Z Rafi22 Broken Device (JOI17_broken_device) C++14
85 / 100
31 ms 3068 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[])
{
    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[i]||bad[i+1]) continue;
        if(x%3==0||x%3==2) res[i]=1;
        if(x%3==1||x%3==2) res[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[])
{
    ll wyn=0,p=1;
    for(int i=0;i<150;i+=2)
    {
        if(a[i]==0&&a[i+1]==0) continue;
        if(a[i]==0&&a[i+1]==1) wyn+=p;
        if(a[i]==1&&a[i+1]==1) wyn+=2*p;
        p*=3;
    }
    return wyn;
}

# Verdict Execution time Memory Grader output
1 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37
2 Partially correct 26 ms 2392 KB Output is partially correct - L* = 37
3 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37
4 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37
5 Partially correct 26 ms 2404 KB Output is partially correct - L* = 37
6 Partially correct 26 ms 2644 KB Output is partially correct - L* = 37
7 Partially correct 28 ms 2624 KB Output is partially correct - L* = 37
8 Partially correct 25 ms 2492 KB Output is partially correct - L* = 37
9 Partially correct 26 ms 2456 KB Output is partially correct - L* = 37
10 Partially correct 28 ms 2480 KB Output is partially correct - L* = 37
11 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37
12 Partially correct 26 ms 2396 KB Output is partially correct - L* = 37
13 Partially correct 26 ms 2396 KB Output is partially correct - L* = 37
14 Partially correct 28 ms 2392 KB Output is partially correct - L* = 37
15 Partially correct 25 ms 2484 KB Output is partially correct - L* = 37
16 Partially correct 25 ms 2400 KB Output is partially correct - L* = 37
17 Partially correct 25 ms 2392 KB Output is partially correct - L* = 37
18 Partially correct 25 ms 2400 KB Output is partially correct - L* = 37
19 Partially correct 26 ms 2400 KB Output is partially correct - L* = 37
20 Partially correct 31 ms 2648 KB Output is partially correct - L* = 37
21 Partially correct 27 ms 2628 KB Output is partially correct - L* = 37
22 Partially correct 25 ms 2480 KB Output is partially correct - L* = 37
23 Partially correct 25 ms 2660 KB Output is partially correct - L* = 37
24 Partially correct 27 ms 2392 KB Output is partially correct - L* = 37
25 Partially correct 28 ms 2396 KB Output is partially correct - L* = 37
26 Partially correct 25 ms 2372 KB Output is partially correct - L* = 37
27 Partially correct 28 ms 2816 KB Output is partially correct - L* = 37
28 Partially correct 27 ms 2404 KB Output is partially correct - L* = 37
29 Partially correct 27 ms 2328 KB Output is partially correct - L* = 37
30 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37
31 Partially correct 26 ms 2396 KB Output is partially correct - L* = 37
32 Partially correct 26 ms 2396 KB Output is partially correct - L* = 37
33 Partially correct 30 ms 3068 KB Output is partially correct - L* = 37
34 Partially correct 25 ms 2484 KB Output is partially correct - L* = 37
35 Partially correct 28 ms 2380 KB Output is partially correct - L* = 37
36 Partially correct 25 ms 2392 KB Output is partially correct - L* = 37
37 Partially correct 27 ms 2304 KB Output is partially correct - L* = 37
38 Partially correct 26 ms 2392 KB Output is partially correct - L* = 37
39 Partially correct 26 ms 2388 KB Output is partially correct - L* = 37
40 Partially correct 25 ms 2404 KB Output is partially correct - L* = 37