답안 #12885

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
12885 2015-01-18T12:51:47 Z gs14004 Languages (IOI10_languages) C++
98 / 100
1252 ms 32236 KB
#include <map>
#include <algorithm>
#include <vector>
#include "lang.h"
#include "grader.h"
using namespace std;

map<long long,int> mp;
vector<long long> v;
const int l = 5;
const int p = 69997;

void excerpt(int *E){
    int cnt[105] = {};
    v.clear();
    for (int i=0; i<96; i++) {
        long long px = 0;
        for (int j=0; j<l; j++) {
            px = p * px + E[i+j];
        }
        map<long long,int> ::iterator it = mp.lower_bound(px);
        if(it != mp.end()) cnt[(*it).second]++;
        v.push_back(px);
    }
    int mv = (int)(max_element(cnt,cnt+56) - cnt);
    int t = language(mv);
    for (int i=0; i<v.size(); i++) {
        mp[v[i]] = t;
    }
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:27:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<v.size(); i++) {
                   ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1252 ms 32236 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1176 ms 32184 KB Output is partially correct - 89.94%