Submission #867621

# Submission time Handle Problem Language Result Execution time Memory
867621 2023-10-29T02:28:09 Z Matjaz Languages (IOI10_languages) C++14
56 / 100
1597 ms 4004 KB

#include <stdlib.h>
#include <stdio.h>
#include <set>
#include <vector>
#include <algorithm>

using namespace std;

#include "grader.h"
#include "lang.h"

#define SZ 100

set<int> S[56];
int L = 56;

void excerpt(int *E) {
    
    set<int> sample(E, E+100);
    
    int best_score = 0;
    int best_guess = 0;
    
    for (int i=0;i<L;i++){
        
        set<int> intersect;
        set_intersection(sample.begin(), sample.end(), S[i].begin(), S[i].end(),
                         std::inserter(intersect, intersect.begin()));
        
        int score = intersect.size();
        
        if (best_score < score){
            best_score = score;
            best_guess = i;
        }
    }
    
    int target = language(best_guess);
    
    S[target].insert(sample.begin(), sample.end());
}
# Verdict Execution time Memory Grader output
1 Correct 1597 ms 4004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 1577 ms 3760 KB Output is partially correct - 52.57%