CSES - Datatähti Open 2017 - Results
Submission details
Task:Family reunion
Sender:koosaga
Submission time:2017-01-21 09:56:23 +0200
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:12:2: error: 'sum' was not declared in this scope
  sum = 16 * 17 / 2;
  ^
input/code.cpp:14:10: error: 'a' was not declared in this scope
   cin >> a[i];
          ^
input/code.cpp:17:2: error: 'a' was not declared in this scope
  a[15] = sum;
  ^
input/code.cpp:11:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%*d %*d %*d");
                      ^

Code

#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef long double llf;

int n = 16;
int m = 1;
int k = 7;

int main(){
	scanf("%*d %*d %*d");
	sum = 16 * 17 / 2;
	for(int i=0; i<2*k+1; i++){
		cin >> a[i];
		sum -= a[i];
	}
	a[15] = sum;
	for(int i=0; i<16; i++){
		if(a[i] == 1){
			if(i % 2 == 1) putchar('A');
			else putchar('B');
		}
	}
}