답안 #512727

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
512727 2022-01-16T17:13:37 Z algorithm16 Languages (IOI10_languages) C++14
95 / 100
7880 ms 15792 KB
#include<iostream>
#include<set>
#include<algorithm>
#include "grader.h"
#include "lang.h"
using namespace std;
typedef long long int llint;
set <llint> s[65],s1;
llint e[105];
void excerpt(int *E) {
	s1.clear();
	for(int i=0;i<100;i++) {
		e[i]=E[i];
		s1.insert(e[i]);
		if(i && (i%2 || i>45)) s1.insert(e[i-1]*1e5+e[i]);
		if(i>1 && (i%2==0 || i>75)) s1.insert(e[i-2]*1e10+e[i-1]*1e5+e[i]);
	}
	int mx=0,idx=0;
	for(int i=0;i<56;i++) {
		if(s[i].size()<=mx) continue;
		int cnt=0;
		for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
			cnt+=(s[i].find(*it)!=s[i].end());
		}
		if(cnt>mx) {
			mx=cnt;
			idx=i;
		}
	}
	int l=language(idx);
	for(set <llint>::iterator it=s1.begin();it!=s1.end();it++) {
		s[l].insert(*it);
	}
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::set<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |   if(s[i].size()<=mx) continue;
      |      ~~~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 7758 ms 15744 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 7880 ms 15792 KB Output is partially correct - 86.82%