답안 #394667

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
394667 2021-04-27T07:14:33 Z MarcoMeijer Languages (IOI10_languages) C++14
0 / 100
10000 ms 80408 KB
#include "grader.h"
#include "lang.h"
#include <bits/stdc++.h>
using namespace std;

// macros
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> lll;
typedef tuple<int, int, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
typedef vector<lll> vlll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#define RE1(a,c) REP(a,1,c+1)
#define REI(a,b,c) REP(a,b,c+1)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define FOR(a,b) for(auto& a : b)
#define all(a) a.begin(), a.end()
#define INF 1e9
#define EPS 1e-9
#define pb push_back
#define popb pop_back
#define fi first
#define se second
#define sz size()
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

map<ii,double> mp[56];
double cnt[56];
set<int> possible;

void excerpt(int *E) {
    int asking = 0; double best = 0.0;
    if(possible.size() != 0) {
        FOR(j,possible) {
            double cur = 0.0;
            RE(i,99) cur += mp[j][{E[i],E[i+1]}];
            if(cur > best) best = cur, asking = j;
        }
    }
    int res = language(asking);
    possible.insert(res);
    FOR(p,mp[res]) p.se *= cnt[res];
    RE(i,99) mp[res][{E[i],E[i+1]}] += 1.0;
    cnt[res] += 1.0;
    FOR(p,mp[res]) p.se /= cnt[res];
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 10019 ms 79808 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 10038 ms 80408 KB Time limit exceeded