Submission #852142

# Submission time Handle Problem Language Result Execution time Memory
852142 2023-09-21T10:03:23 Z Rafi22 Broken Device (JOI17_broken_device) C++14
8 / 100
54 ms 2932 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++)
    {
        bad[i]=0;
        res[i]=0;
    }
    for(int i=0;i<k;i++) bad[P[i]]=1;
    srand(2137);
    vector<int>X;
    for(int i=59;i>=0;i--)
    {
        X.pb(i);
        X.pb(i);
    }
    while(sz(X)<150) X.pb(0);
    random_shuffle(all(X));
    for(int i=59;i>=0;i--)
    {
        for(int j=0;j<150;j++)
        {
            if(X[j]==i&&!bad[j]&&x>=(1LL<<i))
            {
                res[j]=1;
                x-=(1LL<<i);
            }
        }
    }
  //  if(x!=0) cout<<"XDDDDDD"<<endl;
    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>X;
    for(int i=59;i>=0;i--)
    {
        X.pb(i);
        X.pb(i);
    }
    while(sz(X)<150) X.pb(0);
    random_shuffle(all(X));
    ll wyn=0;
    for(int i=0;i<150;i++)
    {
        if(a[i]==1) wyn+=(1LL<<X[i]);
    }
    return wyn;
}

# Verdict Execution time Memory Grader output
1 Partially correct 43 ms 2548 KB Output is partially correct - L* = 14
2 Partially correct 49 ms 2376 KB Output is partially correct - L* = 15
3 Partially correct 43 ms 2932 KB Output is partially correct - L* = 14
4 Partially correct 43 ms 2364 KB Output is partially correct - L* = 14
5 Partially correct 42 ms 2396 KB Output is partially correct - L* = 16
6 Partially correct 39 ms 2336 KB Output is partially correct - L* = 14
7 Partially correct 40 ms 2296 KB Output is partially correct - L* = 15
8 Partially correct 54 ms 2344 KB Output is partially correct - L* = 16
9 Partially correct 53 ms 2496 KB Output is partially correct - L* = 18
10 Partially correct 49 ms 2372 KB Output is partially correct - L* = 15
11 Partially correct 53 ms 2296 KB Output is partially correct - L* = 14
12 Partially correct 39 ms 2340 KB Output is partially correct - L* = 14
13 Partially correct 38 ms 2660 KB Output is partially correct - L* = 17
14 Partially correct 38 ms 2400 KB Output is partially correct - L* = 16
15 Partially correct 44 ms 2500 KB Output is partially correct - L* = 14
16 Partially correct 45 ms 2372 KB Output is partially correct - L* = 14
17 Partially correct 38 ms 2404 KB Output is partially correct - L* = 16
18 Partially correct 40 ms 2408 KB Output is partially correct - L* = 14
19 Partially correct 39 ms 2816 KB Output is partially correct - L* = 14
20 Partially correct 42 ms 2396 KB Output is partially correct - L* = 16
21 Partially correct 39 ms 2360 KB Output is partially correct - L* = 17
22 Partially correct 41 ms 2404 KB Output is partially correct - L* = 14
23 Partially correct 41 ms 2464 KB Output is partially correct - L* = 15
24 Partially correct 39 ms 2300 KB Output is partially correct - L* = 15
25 Partially correct 39 ms 2372 KB Output is partially correct - L* = 17
26 Partially correct 39 ms 2396 KB Output is partially correct - L* = 14
27 Partially correct 39 ms 2468 KB Output is partially correct - L* = 15
28 Partially correct 40 ms 2452 KB Output is partially correct - L* = 14
29 Partially correct 40 ms 2420 KB Output is partially correct - L* = 15
30 Partially correct 39 ms 2484 KB Output is partially correct - L* = 15
31 Partially correct 39 ms 2396 KB Output is partially correct - L* = 14
32 Partially correct 51 ms 2512 KB Output is partially correct - L* = 14
33 Partially correct 38 ms 2372 KB Output is partially correct - L* = 14
34 Partially correct 40 ms 2424 KB Output is partially correct - L* = 15
35 Partially correct 39 ms 2372 KB Output is partially correct - L* = 15
36 Partially correct 39 ms 2308 KB Output is partially correct - L* = 15
37 Partially correct 38 ms 2484 KB Output is partially correct - L* = 14
38 Partially correct 39 ms 2548 KB Output is partially correct - L* = 14
39 Partially correct 41 ms 2300 KB Output is partially correct - L* = 14
40 Partially correct 44 ms 2396 KB Output is partially correct - L* = 14