Submission #61236

# Submission time Handle Problem Language Result Execution time Memory
61236 2018-07-25T12:07:45 Z reality Languages (IOI10_languages) C++17
97 / 100
4672 ms 40300 KB
#include "grader.h"
#include "lang.h"
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}
 
#define U unsigned ll
 
#define SZ 100
 
const int K = 5;
 
int was[1111111];
 
map < U , U > T;
 
const db C[] = {1.0,1.0,1.0 / 2,1.0 / 6,1.0 / 24,1.0 / 120,1.0 / 720};
 
ll f(auto x) {
	return x;
}
 
int called = 0;
 
void excerpt(int *E) {
	++called;
	int n = SZ;
	vector < U > M;
	for (int i = 0;i < n;++i) {
		U cnt = 1;
		int lm = i + K;
		for (int j = i;j < n && j < lm;++j)
			if (1) {//!('0' <= E[j] && E[j] <= '9') && !(E[j] == '-' || E[j] == '.' || E[j] == '(' || E[j] == ')' || E[j] == ' ' || E[j] == ',' || E[j] == '\"')) {
				cnt *= E[j];
				M.pb(cnt);
			} else {
				break;
			}
	}
	vector < pair < int , U > > ss;
	sort(all(M));
	int szz = M.size();
	for (int i = 0,j;i < szz;i = j) {
		j = i;
		while (j < szz && M[i] == M[j])
			++j;
		ss.pb(mp(j - i,M[i]));
	}
	sort(all(ss));
	vector < ll > sim(56,0);
	for (auto it : ss) {
		ll mask = T[it.se];
		for (int i = 0;i < 56;++i)
			if (!((mask >> i) & 1))
				sim[i] += f(it.fi);
	}
	int ans = min_element(all(sim)) - sim.begin();
	int real_ans = language(ans);
	for (auto it : ss)
		T[it.se] |= 1ll << real_ans;
}
# Verdict Execution time Memory Grader output
1 Correct 4206 ms 40124 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 4672 ms 40300 KB Output is partially correct - 88.85%