Submission #232588

# Submission time Handle Problem Language Result Execution time Memory
232588 2020-05-17T13:51:20 Z crossing0ver Languages (IOI10_languages) C++17
56 / 100
541 ms 2052 KB
#include<bits/stdc++.h>
#include "grader.h"
#include "lang.h"
using namespace std;
bool s[56][65536];
int A[56];
vector<int> G;
int vis[65536];
void excerpt(int E[]) {
	int ca = 1;
	for (int i = 0; i <= 55; i++) {
	for (int j = 0; j < 100; j++) {
		G.push_back(E[j]);
		if (s[i][E[j]] && !vis[E[j]])
		if (j == 0)  A[i] += 2, vis[E[j]] = 1;
		else 
			A[i]++, vis[E[j]] = 1;
		}
		for (int g:G) vis[g] = 0;
		G.clear(); 
	}
	for (int i = 0; i <= 55; i++)
		if (A[i] > A[ca]) ca = i;
	memset (A,0,sizeof A);
	int d = language(ca);
	for (int i = 0; i < 100; i++)
		s[d][E[i]]|=1;
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:14:6: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   if (s[i][E[j]] && !vis[E[j]])
      ^
# Verdict Execution time Memory Grader output
1 Correct 541 ms 2052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 533 ms 2036 KB Output is partially correct - 52.60%