| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 660237 | QwertyPi | Languages (IOI10_languages) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
