Submission #131311

# Submission time Handle Problem Language Result Execution time Memory
131311 2019-07-17T03:52:52 Z dragonslayerit Languages (IOI10_languages) C++14
98 / 100
6222 ms 22124 KB
#include <stdlib.h>
#include <stdio.h>
#include <set>
#include <map>
#include <algorithm>
#include <stdint.h>
#include <unordered_set>
     
#include "grader.h"
#include "lang.h"
     
std::unordered_set<uint64_t> had[56];

void excerpt(int *E) {
  std::set<uint64_t> distinct;
  for(int i=0;i<100-3;i++){
    distinct.insert(uint64_t(E[i])<<48|uint64_t(E[i+1])<<32|uint64_t(E[i+2])<<16|uint64_t(E[i+3]));
  }
  int sim[56]={};
  for(int l=0;l<56;l++){
    for(uint64_t c:distinct){
      sim[l]+=had[l].count(c);
    }
  }
  int guess=std::max_element(sim,sim+56)-sim;
  int ans=language(guess);
  for(uint64_t c:distinct){
    had[ans].insert(c);
  }
}
# Verdict Execution time Memory Grader output
1 Correct 5753 ms 22124 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 6222 ms 22012 KB Output is partially correct - 89.27%