Submission #65826

# Submission time Handle Problem Language Result Execution time Memory
65826 2018-08-09T01:01:34 Z jaehun630 Languages (IOI10_languages) C++14
0 / 100
10000 ms 4528 KB
#include <stdlib.h>
#include <stdio.h>
#include <vector>

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

#define SZ 100
#define max(a,b) (a>b?a:b)
int prev[1100000];
std::vector<int> v[65536];

void excerpt(int *E) {	
	int lang[56];
	for (int i = 0; i < 56; i++) lang[i] = 0;

	for (int i = 0; i < 100; i++)
		if (v[E[i]].size() > 0)
			for(int j = 0; j<v[E[i]].size(); j++)
				lang[v[E[i]].at(j)]++;

	int idx = 0, cnt = 0;
	for (int i = 0; i < 56; i++)
		if (cnt < lang[i])
			cnt = lang[i], idx = i;

	int ans = language(idx);

	for (int i = 0; i < 100; i++)
		v[E[i]].push_back(ans);
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:19:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int j = 0; j<v[E[i]].size(); j++)
                   ~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 10013 ms 4528 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10013 ms 4336 KB Time limit exceeded