Submission #660237

# Submission time Handle Problem Language Result Execution time Memory
660237 2022-11-21T09:29:49 Z QwertyPi Languages (IOI10_languages) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 10000, M = 100, L = 56;
int cnt[56][65536], s[65536], tr[56];
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

vector<int> line(){
	vector<int> ret;
	for(int i = 0; i < M; i++){
		int v; cin >> v;
		ret.push_back(v);
	}
	return ret;
}

long double sc(vector<int>& l, int lang){
	long double ret = 0;
	for(auto i : l){
		if(s[i] == 0) continue;
		if(cnt[lang][i] == s[i]) ret += 1;
		ret += (long double) cnt[lang][i] / s[i] / tr[lang];
	}
	return ret;
}

int main() {
	int correct = 0;
	for(int i = 0; i < N; i++){
		vector<int> l = line();
		vector<int> ord; for(int i = 0; i < L; i++) ord.push_back(i);
		for(int i = 0; i < L; i++) swap(ord[i], ord[rng() % (i + 1)]);
		int ans = -1;
		long double val = -1;
		for(int i = 0; i < L; i++){
			long double score = sc(l, ord[i]);
			if(score > val){
				val = score;
				ans = ord[i];
			}
		}
#ifdef ONLINE_JUDGE
		cout << ans << endl;
#endif
		int rans; cin >> rans;
		if(ans == rans) correct++;
		tr[rans]++;
		for(auto i : l){
			cnt[rans][i]++;
			s[i]++;
		}
	}
#ifndef ONLINE_JUDGE
		printf("Percentage: %2.2f%%", (float) correct / N * 100);
#endif
	return 0;
}

Compilation message

/usr/bin/ld: /tmp/ccFUUlKK.o: in function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'; /tmp/ccNqFvwK.o:lang.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccFUUlKK.o: in function `main':
grader.c:(.text.startup+0x12f): undefined reference to `excerpt(int*)'
collect2: error: ld returned 1 exit status