답안 #204920

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
204920 2020-02-27T13:00:02 Z MetB Languages (IOI10_languages) C++14
0 / 100
36 ms 14968 KB
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
 
using namespace std;
 
int a[4][56][300000], b[4][300000];
int cnt[4][300000];
const int MOD = 2999993;
 
void excerpt (int* E) {
    int n = 100;
    memset (cnt, 0, sizeof (cnt));
    std::vector <int> s[5];
    
    for (int i = 0; i < 100; i++) {
        int val = 1;
        for (int j = 0; j < min (4, n - i); j++) {
            val = val * E[i+j] % MOD;
            cnt[j][val]++;
            s[j].push_back (val);
        }
    }
    
    for (int i = 0; i < 4; i++) {
        sort (s[i].begin (), s[i].end ());
        s[i].erase (unique (s[i].begin (), s[i].end ()), s[i].end ());
    }
    
    double mx = 0;
    int x = 0;
    
    for (int i = 0; i < 56; i++) {
        double points = 0;
        
        for (int k = 0; k < 4; k++) {
            for (int j : s[k]) {
                if (b[k][j]) points += cnt[k][j] * ((double) a[k][i][j] / b[k][j]) * (k + 1);
            }
        }
        
        if (mx < points) {
            mx = points;
            x = i;
        }
    }
    
    x = language (x);
    
    for (int i = 0; i < 100; i++) {
        for (int j = 0; j < min (4, n - i); j++) {
            int val = 1;
            for (int k = 0; k <= j; k++)
                val = val * E[i+k] % MOD;
            a[j][x][val]++;
            b[j][val]++;
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 36 ms 14968 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 35 ms 14944 KB Execution killed with signal 11 (could be triggered by violating memory limits)