| Task: | Family reunion |
| Sender: | eduardische |
| Submission time: | 2017-01-20 02:02:12 +0200 |
| Language: | C++ |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | UNKNOWN | 0 |
| #2 | UNKNOWN | 0 |
| #3 | UNKNOWN | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | UNKNOWN | -- | 1 | details |
| #2 | UNKNOWN | -- | 2 | details |
| #3 | UNKNOWN | -- | 3 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:13:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d",&N,&M,&K);
^
input/code.cpp:18:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a[i]);
^Code
#include <bits/stdc++.h>
#define MAXK 25
using namespace std;
int getColour (int num) {
srand(num);
return rand() % 3;
}
int main () {
int N, M, K;
scanf("%d %d %d",&N,&M,&K);
int i, j;
static int a[MAXK];
for (j = 0; j < M; j++) {
for (i = 0; i < 2*K+1; i++) {
scanf("%d",&a[i]);
}
int c = getColour(a[K]);
int z = 1;
while (z <= K) {
if ((getColour(a[K-z]) != c) || (getColour(a[K+z] != c))) {
break;
}
z++;
}
if (z == K) {
printf("SHIT\n");
return 1;
}
int res = c;
if (z > 1) {
res = (res + (z % 2) + 1) % 3;
}
if (res == 0) {
printf("A\n");
} else if (res == 1) {
printf("B\n");
} else {
printf("C\n");
}
}
return 0;
}
Test details
Test 1
Group: 1
Verdict: UNKNOWN
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (not available) |
Test 2
Group: 2
Verdict: UNKNOWN
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (not available) |
Test 3
Group: 3
Verdict: UNKNOWN
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (not available) |
