QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#179007 | #6110. Squirrel Game | Zhou_JK | WA | 0ms | 3868kb | C++23 | 2.1kb | 2023-09-14 16:35:01 | 2023-09-14 16:35:02 |
Judging History
answer
#include <bits/stdc++.h>
#ifndef LOCAL
#define debug(...)
#else
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#endif
#define rep1(a) for (int i = 0; i < a; i++)
#define rep2(i, a) for (int i = 0; i < a; i++)
#define rep3(i, a, b) for (int i = a; i < b; i++)
#define rep4(i, a, b, c) for (int i = a; i < b; i += c)
#define overload4(a, b, c, d, e, ...) e
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define pb emplace_back
using namespace std;
template <typename T, typename T2> void cmin(T &x, const T2 &y) {
x = x < y ? x : y;
}
template <typename T, typename T2> void cmax(T &x, const T2 &y) {
x = x > y ? x : y;
}
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
template <class T> using vc = vector<T>;
template <class T> using pq = priority_queue<T>;
template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
mt19937 rng(time(NULL));
const int inf = 1000000000;
const ll lnf = 1000000000000000000;
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
template <class... T> void read() {}
template <class T> void read(T &x) { cin >> x; }
template <class T, class S> void read(pair<T, S> &v) {
read(v.first, v.second);
}
template <class T> void read(vector<T> &v) {
for (T &x : v)
read(x);
}
template <class T, class... Ts> void read(T &a, Ts &...b) {
read(a), read(b...);
}
void solve() {
int m, n, k;
cin >> m >> n >> k;
vi a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> d{a[0]};
for (int i = 1; i < n; i++) {
d.pb(a[i] - a[i - 1]);
}
for (int i = 0; i < n; i++) {
d[i] -= 1;
}
vi s(k);
for (int i = 0; i < n; i++) {
d[i] += s[i % k];
s[i % k] = d[i];
}
int x = 0;
for (int i = 0; i < n; i++) {
x ^= d[i];
}
if (x == 0) {
cout << "Nova\n";
} else {
cout << "Twinkle\n";
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3636kb
input:
7 3 2 1 4 7
output:
Nova
result:
ok single line: 'Nova'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
7 3 1 1 4 7
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
1 1 1 1
output:
Nova
result:
ok single line: 'Nova'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
1 1 10 1
output:
Nova
result:
ok single line: 'Nova'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
100000 1 1 19593
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
100000 1 10 62516
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
100 10 1 23 24 43 47 62 66 68 73 82 85
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
100 10 3 11 18 23 26 30 40 52 76 78 99
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
100 10 7 14 27 51 62 66 71 75 79 80 97
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
100 10 10 10 18 25 50 51 54 64 77 95 96
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
100 5 10 15 52 61 65 78
output:
Twinkle
result:
ok single line: 'Twinkle'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
10 10 1 1 2 3 4 5 6 7 8 9 10
output:
Nova
result:
ok single line: 'Nova'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
10 10 3 1 2 3 4 5 6 7 8 9 10
output:
Nova
result:
ok single line: 'Nova'
Test #14:
score: -100
Wrong Answer
time: 0ms
memory: 3692kb
input:
100 10 1 5 16 25 28 39 49 58 63 79 85
output:
Twinkle
result:
wrong answer 1st lines differ - expected: 'Nova', found: 'Twinkle'