Submission #1113126

# Submission time Handle Problem Language Result Execution time Memory
1113126 2024-11-15T20:06:51 Z ttamx Broken Device (JOI17_broken_device) C++17
0 / 100
48 ms 2792 KB
#include "Annalib.h"
#include<bits/stdc++.h>

using namespace std;

void Anna(int n,long long x,int k,int p[]){
	using ull = uint64_t;
	mt19937_64 rng(0);
	vector<ull> basis(40),way(40);
	vector<int> id(40,-1);
	auto add=[&](ull x,int i){
		ull w=0;
		for(int b=39;b>=0;b--){
			if(x>>b&1){
				if(id[b]==-1){
					basis[b]=x;
					way[b]=w|(1ULL<<b);
					id[b]=i;
					return;
				}
				x^=basis[b];
				w^=way[b];
			}
		}
	};
	vector<bool> ok(n,true);
	for(int i=0;i<k;i++){
		ok[p[i]]=false;
	}
	for(int i=0;i<n;i++){
		ull val=rng();
		if(ok[i]){
			add(val,i);
		}
	}
	vector<int> ans(n);
	ull w=0;
	for(int i=39;i>=0;i--){
		if(x>>i&1){
			x^=basis[i];
			w^=way[i];
		}
	}
	for(int i=39;i>=0;i--){
		if(w>>i&1){
			ans[id[i]]=1;
		}
	}
	for(int i=0;i<n;i++){
		Set(i,ans[i]);
	}
}
#include "Brunolib.h"
#include<bits/stdc++.h>

using namespace std;

long long Bruno(int n,int a[]){
	mt19937_64 rng(0);
	uint64_t ans=0;
	for(int i=0;i<n;i++){
		uint64_t val=rng();
		if(a[i]){
			ans^=val;
		}
	}
  	return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 44 ms 2620 KB Output isn't correct - L* = 0
2 Partially correct 40 ms 2440 KB Output isn't correct - L* = 0
3 Partially correct 41 ms 2620 KB Output isn't correct - L* = 0
4 Partially correct 48 ms 2624 KB Output isn't correct - L* = 0
5 Partially correct 40 ms 2624 KB Output isn't correct - L* = 0
6 Partially correct 42 ms 2620 KB Output isn't correct - L* = 0
7 Partially correct 40 ms 2632 KB Output isn't correct - L* = 0
8 Partially correct 41 ms 2472 KB Output isn't correct - L* = 0
9 Partially correct 41 ms 2612 KB Output isn't correct - L* = 0
10 Partially correct 41 ms 2620 KB Output isn't correct - L* = 0
11 Partially correct 41 ms 2620 KB Output isn't correct - L* = 0
12 Partially correct 38 ms 2664 KB Output isn't correct - L* = 0
13 Partially correct 38 ms 2632 KB Output isn't correct - L* = 0
14 Partially correct 40 ms 2580 KB Output isn't correct - L* = 0
15 Partially correct 39 ms 2644 KB Output isn't correct - L* = 0
16 Partially correct 39 ms 2616 KB Output isn't correct - L* = 0
17 Partially correct 38 ms 2444 KB Output isn't correct - L* = 0
18 Partially correct 39 ms 2632 KB Output isn't correct - L* = 0
19 Partially correct 39 ms 2620 KB Output isn't correct - L* = 0
20 Partially correct 39 ms 2612 KB Output isn't correct - L* = 0
21 Partially correct 39 ms 2616 KB Output isn't correct - L* = 0
22 Partially correct 38 ms 2612 KB Output isn't correct - L* = 0
23 Partially correct 40 ms 2548 KB Output isn't correct - L* = 0
24 Partially correct 38 ms 2644 KB Output isn't correct - L* = 0
25 Partially correct 39 ms 2620 KB Output isn't correct - L* = 0
26 Partially correct 38 ms 2536 KB Output isn't correct - L* = 0
27 Partially correct 39 ms 2632 KB Output isn't correct - L* = 0
28 Partially correct 38 ms 2732 KB Output isn't correct - L* = 0
29 Partially correct 38 ms 2624 KB Output isn't correct - L* = 0
30 Partially correct 42 ms 2620 KB Output isn't correct - L* = 0
31 Partially correct 40 ms 2380 KB Output isn't correct - L* = 0
32 Partially correct 38 ms 2632 KB Output isn't correct - L* = 0
33 Partially correct 41 ms 2612 KB Output isn't correct - L* = 0
34 Partially correct 43 ms 2792 KB Output isn't correct - L* = 0
35 Partially correct 42 ms 2620 KB Output isn't correct - L* = 0
36 Partially correct 47 ms 2648 KB Output isn't correct - L* = 0
37 Partially correct 42 ms 2604 KB Output isn't correct - L* = 0
38 Partially correct 41 ms 2380 KB Output isn't correct - L* = 0
39 Partially correct 43 ms 2672 KB Output isn't correct - L* = 0
40 Partially correct 41 ms 2612 KB Output isn't correct - L* = 0