Submission #204870

# Submission time Handle Problem Language Result Execution time Memory
204870 2020-02-27T11:48:55 Z MetB Languages (IOI10_languages) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

int a[50][100000], b[100000];

void excerpt (int* E) {
    int cnt[100000];
    memset (cnt, 0, sizeof (cnt));
    std::set <int> s;
    
    for (int i = 0; i < 100; i++) {
        cnt[E[i]]++;
        s.insert (E[i]);
    }
    
    double mx = 0;
    int x = 0;
    
    for (int i = 0; i < 50; i++) {
        double  points = 0;
        for (int j  : s) {
            if (b[j]) points += cnt[j] * (a[i][j] / b[j]);
        }
        
        if (points > mx) {
            mx = points;
            x = i;
        }
    }
    
    language (x);
    
    for (int i = 0; i < 100; i++) {
        b[E[i]]++;
        a[x][E[i]]++;
    }
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:30:5: error: 'language' was not declared in this scope
     language (x);
     ^~~~~~~~