| Task: | Sukujuhla |
| Sender: | Kuha |
| Submission time: | 2017-01-22 12:10:38 +0200 |
| Language: | C++ |
| Status: | READY |
| Result: | 51 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 19 |
| #2 | ACCEPTED | 32 |
| #3 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.10 s | 1 | details |
| #2 | ACCEPTED | 0.12 s | 2 | details |
| #3 | WRONG ANSWER | 1.50 s | 3 | details |
Code
#include <bits/stdc++.h>
#define N (1<<18)
#define ll long long
#define ld long double
#define M 1000000007
#define INF 1000000007
#define LINF 1000000000000000007LL
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pb push_back
#define F first
#define S second
#define L length() - 1
using namespace std;
int h (int n) {
return ((int)sqrt(n) + n) % 3;
}
int main () {
int n, m, k;
cin>>n>>m>>k;
for (int i = 0; i < m; i++) {
int v[2 * k + 1];
for (int i = 0; i < 2 * k + 1; i++) {
cin>>v[i];
v[i] = h(v[i]);
}
for (int i = 0; i <= k; i++) {
while (v[i] == v[i + 1] || v[i + 1] == v[i + 2]) {
v[i + 1] = (v[i + 1] + 1) % 3;
}
}
if (!v[k]) cout<<"A"<<endl;
else if (v[k] & 1) cout<<"B"<<endl;
else cout<<"C"<<endl;
}
}Test details
Test 1
Group: 1
Verdict: ACCEPTED
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| A C A ... Truncated |
Test 2
Group: 2
Verdict: ACCEPTED
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| B A C A C ... Truncated |
Test 3
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| A A A C C ... Truncated |
