Codeforces Round 1008 (Div. 2)

比赛链接

Problems AC Note
A. Final Verdict ○
B. Vicious Labyrinth ○
C. Breach of Faith ○
D. Scammy Game Ad ○
E. Finding OR Sum ⊕
F. Binary Subsequence Value Sum ○
G. Another Folding Strip

A

Code >folded
1
2
3
4
5
6
7
8
9
10
11
12
13
14
void solve() {
int n = read();
int x = read();
vector<int> a(n);
for (auto &x : a) x = read();
int sum = 0;
for (auto &x : a) sum += x;
if (sum == x * n) {
puts("YES");
} else {
puts("NO");
}
int ans = 0;
}

B

Code >folded
1
2
3
4
5
6
7
8
9
10
11
12
13
14
void solve() {
int n = read();
int k = read();
vector<int> a(n + 1);
if (k % 2 == 0) {
a[n] = n - 1;
for (int i = 1; i < n; i++) a[i] = n - 1;
a[n - 1] = n;
} else {
a[n] = n - 1;
for (int i = 1; i < n; i++) a[i] = n;
}
for (int i = 1; i <= n; i++) cout << a[i] << " \n"[i == n];
}

C

Code >folded
1

D

Code >folded
1

E

Code >folded
1

Author

TosakaUCW

Posted on

2025-03-13

Updated on

2025-03-13

Licensed under

Comments