# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
363396 | cig32 | Languages (IOI10_languages) | C++17 | 10117 ms | 253124 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "lang.h"
#include "grader.h"
using namespace std;
int word[65536][56];
int totcnt[65536];
unordered_map<int,int>paircnt[56];
double newtiles[56];
int anscnt[56];
int test_case=0;
int space_character;
double diff=0;
void excerpt(int *a){
test_case++;
if(test_case==20){
int mm=0;
for(int i=0;i<65536;i++){
mm=max(mm,totcnt[i]);
}
for(int i=0;i<65536;i++){
if(mm==totcnt[i]){
space_character=i;
break;
}
}
}
double s[56];
double m=0;
int newcnt=0;
for(int j=0;j<56;j++)s[j]=0;
for(int j=0;j<100;j++){
for(int k=0;k<56;k++){
if(a[j]==space_character)continue;
if(totcnt[a[j]])s[k]+=word[a[j]][k]*1.0/totcnt[a[j]];
else newcnt++;
}
}
for(int j=0;j<100;j++){
int x=rand()%100;
int y=rand()%100;
if(a[x]==space_character || a[y]==space_character)continue;
for(int k=0;k<56;k++){
s[k]+=0.05*paircnt[k][a[x]*65536+a[y]];
}
}
newcnt/=56;
for(int j=0;j<56;j++){
s[j]+=0.05*(100-abs(newtiles[j]-newcnt));
m=max(m,s[j]);
}
for(int j=0;j<100;j++){
totcnt[a[j]]++;
}
int ans;
for(int j=0;j<56;j++){
if(s[j]==m){
ans=language(j);
if(ans!=j){
diff+=s[j]-s[ans];
}
break;
}
}
newtiles[ans]=(newtiles[ans]*anscnt[ans]+newcnt)*1.0;
anscnt[ans]++;
newtiles[ans]/=anscnt[ans];
for(int j=0;j<100;j++){
word[a[j]][ans]++;
}
for(int j=0;j<100;j++){
for(int k=0;k<100;k++){
if(j!=k && a[j]!=space_character && a[k]!=space_character){
paircnt[ans][a[j]*65536+a[k]]++;
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |