Submission #204881

# Submission time Handle Problem Language Result Execution time Memory
204881 2020-02-27T11:59:47 Z MetB Languages (IOI10_languages) C++14
72 / 100
580 ms 3564 KB
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"

int a[56][100000], b[100000];
int cnt[100000];

void excerpt (int* E) {
    memset (cnt, 0, sizeof (cnt));
    std::set <int> s;
    
    for (int i = 0; i < 100; i++) {
        cnt[E[i] % 100000]++;
        s.insert (E[i] % 100000);
    }
    
    double mx = 0;
    int x = 0;
    
    for (int i = 0; i < 56; i++) {
        double  points = 0;
        for (int j : s) {
            if (b[j]) points += cnt[j] * ((double) a[i][j] / b[j]);
        }
        
        if (points > mx) {
            mx = points;
            x = i;
        }
    }
    
    x = language (x);
    
    for (int i = 0; i < 100; i++) {
        b[E[i] % 100000]++;
        a[x][E[i] % 100000]++;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 580 ms 3448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 501 ms 3564 KB Output is partially correct - 66.52%