제출 #412819

#제출 시각아이디문제언어결과실행 시간메모리
412819b00n0rpLanguages (IOI10_languages)C++17
65 / 100
5877 ms91256 KiB
#include <bits/stdc++.h> using namespace std; #include "grader.h" #include "lang.h" typedef long double LD; typedef long long ll; #define int ll #define pb push_back #define mp make_pair #define REP(i,n) for (int i = 0; i < n; i++) #define FOR(i,a,b) for (int i = a; i < b; i++) #define REPD(i,n) for (int i = n-1; i >= 0; i--) #define FORD(i,a,b) for (int i = a; i >= b; i--) #define remax(a,b) a = max(a,b) #define remin(a,b) a = min(a,b) #define all(v) v.begin(),v.end() typedef unordered_map<int,int> mii; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int,int> pii; typedef vector<pii> vpii; #define F first #define S second #define PQ(type) priority_queue<type> #define PQD(type) priority_queue<type,vector<type>,greater<type> > #define WL(t) while(t --) #define SZ(x) ((int)(x).size()) #define runtime() ((double)clock() / CLOCKS_PER_SEC) #define inrange(i,a,b) ((i>=min(a,b)) && (i<=max(a,b))) const int LA = 56; const int CH = 65536; const int SZ = 100; int cnt1[LA][CH]; mii cnt2[LA]; // mii cnt3[LA]; int tot[LA]; void excerpt(signed *E){ int l = 0; pii f = {0,1}; REP(i,LA){ int num = 0; int den = tot[i]+1; REP(j,SZ){ num += cnt1[i][E[j]]; } REP(j,SZ-1){ num += cnt2[i][E[j]*CH+E[j+1]]*SZ; } // REP(j,SZ-2){ // num += cnt3[i][E[j]*CH*CH+E[j+1]*CH+E[j+2]]*SZ*SZ; // } if(f.F*den < num*f.S){ f = {num,den}; l = i; } } int lang = language(l); tot[lang] += SZ; REP(i,100) cnt1[lang][E[i]]++; REP(i,99) cnt2[lang][E[i]*CH+E[i+1]]++; // REP(i,98) cnt3[lang][E[i]*CH*CH+E[i+1]*CH+E[i+2]]++; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...