Submission #44975

# Submission time Handle Problem Language Result Execution time Memory
44975 2018-04-10T09:06:44 Z junodeveloper Languages (IOI10_languages) C++14
Compilation error
0 ms 0 KB
#include "lang.h"
#include "grader.h"
#include <map>
#include <algorithm>
using namespace std;
typedef unsigned long long ll;
map<ll, int> mp[56];
ll cnt[56] = {0};
void excerpt(int* a) {
	memset(cnt, 0, sizeof(cnt));
	for(int i=0; i<97; i++) {
		ll val = 0;
		for(int j=0; j<4; j++)
			val = val * 65535 + a[i] - 1;
		int mx = 0, idx = 0;
		for(int j=0; j<56; j++)
			if(mx < mp[j][val])
			mx = mp[j][val], idx = j;
		cnt[idx] += mx;
	}
	int ret = max_element(cnt, cnt+56) - cnt;
	int ans = language(ret);
	for(int i=0; i<97; i++) {
		ll val = 0;
		for(int j=0; j<4; j++)
			val = val * 65535 + a[i] - 1;
		mp[ans][val]++;
	}
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:10:2: error: 'memset' was not declared in this scope
  memset(cnt, 0, sizeof(cnt));
  ^~~~~~
lang.cpp:10:2: note: suggested alternative: 'wmemset'
  memset(cnt, 0, sizeof(cnt));
  ^~~~~~
  wmemset