Submission #173698

# Submission time Handle Problem Language Result Execution time Memory
173698 2020-01-05T06:58:08 Z sean617 Languages (IOI10_languages) C++
56 / 100
261 ms 2936 KB
#include "grader.h"
#include "lang.h"
#include <unordered_map>
#include <vector>
#include <cstring>

using namespace std;
int l, v[60][100000];
void excerpt(int *E)
{
	int i, j, num, ans = 0, x, mx = 0, cnt;
	l = 100;
	for (x =0; x < 56; x++) {
		cnt = 0;
		for (i =0; i < l; i++) {
			cnt += v[x][E[i]];
		}
		if (cnt > mx) {
			mx = cnt;
			ans = x;
		}
	}
	ans = language(ans);
	for (i = 0; i < l; i++) {
		v[ans][E[i]] = 1;
	}
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:11:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j, num, ans = 0, x, mx = 0, cnt;
         ^
lang.cpp:11:12: warning: unused variable 'num' [-Wunused-variable]
  int i, j, num, ans = 0, x, mx = 0, cnt;
            ^~~
# Verdict Execution time Memory Grader output
1 Correct 261 ms 2936 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 231 ms 2936 KB Output is partially correct - 52.92%