Submission #1046084

# Submission time Handle Problem Language Result Execution time Memory
1046084 2024-08-06T09:50:35 Z Tob Magic Show (APIO24_show) C++17
0 / 100
1 ms 1076 KB
#include <bits/stdc++.h>
#include "Alice.h"

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

const int B = 80, bit = 60, seed = 12345;

vector <pii> Alice() {
	int w = B*bit;
	vector <int> p;
	int d = seed;
	for (int i = 0; i < w; i++, d = ((d * 3 / 2) & (1 << 20)-1)) p.pb((i+d)%bit);
	
	ll x = setN(w+2);
	vector <pii> res;
	res = {{w+1, w+2}};
	
	for (int i = 0; i < w; i++) {
		if (x & (1LL << p[i])) res.pb({i+1, i+2});
		else res.pb({i+1, i+3});
	}
	return res;
}
#include <bits/stdc++.h>
#include "Bob.h"

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

const int B = 80, bit = 60, seed = 12345;

ll Bob(vector <pii> v) {
	int w = B*bit;
	vector <int> p;
	int d = seed;
	for (int i = 0; i < w; i++, d = ((d * 3 / 2) & (1 << 20)-1)) p.pb((i+d)%bit); 
	
	ll res = 0;
	for (auto x : v) if (x.F != w+1 && x.F+1 == x.S) res |= (1LL << p[x.F-1]);
	
	return res;
}

Compilation message

Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:21:58: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   21 |  for (int i = 0; i < w; i++, d = ((d * 3 / 2) & (1 << 20)-1)) p.pb((i+d)%bit);
      |                                                 ~~~~~~~~~^~

Bob.cpp: In function 'll Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:21:58: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   21 |  for (int i = 0; i < w; i++, d = ((d * 3 / 2) & (1 << 20)-1)) p.pb((i+d)%bit);
      |                                                 ~~~~~~~~~^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 820 KB Correct.
2 Incorrect 1 ms 1076 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 820 KB Correct.
2 Incorrect 1 ms 1076 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 820 KB Correct.
2 Incorrect 1 ms 1076 KB Incorrect answer.
3 Halted 0 ms 0 KB -