CSES - Datatähti Open 2017 - Results
Submission details
Task:Family reunion
Sender:eduardische
Submission time:2017-01-20 03:30:50 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#1UNKNOWN0
#2UNKNOWN0
#3UNKNOWN0
Test results
testverdicttimegroup
#1UNKNOWN--1details
#2UNKNOWN--2details
#3UNKNOWN--3details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:26: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:31: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, int max) {
	int tm = num % 10;
	mt19937 mt(num % 30000);
    uniform_int_distribution<int> dist(0, max - 1);
    int res = dist(mt);
    for (int z = 0; z < tm; z++) {
    	res = dist(mt);
    	if (res * 1000000001 == num) {
    		return res;
    	}
    }
    return res;
}

int notColour (int c1, int c2) {
	return 3 - c1 - c2;
}

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 sz = 81;
		while (1) {
			int c = getColour(a[K], sz);
			int l = 1;
			while (l <= K) {
				if (getColour(a[K-l], sz) != c) {
					break;
				}
				l++;
			}
			int r = 1;
			while (r <= K) {
				if (getColour(a[K+r], sz) != c) {
					break;
				}
				r++;
			}
			if ((l > K) || (r > K)) {
				return 1;
			}
			int res = 0;
			int len = r - l - 1;
			if (len == 1) {
				int l2 = l+1;
				while (l2 <= K) {
					if (getColour(a[K-l2], sz) == getColour(a[K-l2+1], sz)) {
						break;
					}
					l2++;
				}
				if (l2 > K) {
					return 1;
				}
			}

			if (res == 0) {
				printf("A\n");
			} else if (res == 1) {
				printf("B\n");
			} else {
				printf("C\n");
			}
			break;
		}

	}
	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)