Submission #8073

# Submission time Handle Problem Language Result Execution time Memory
8073 2014-08-28T10:41:07 Z woqja125 Languages (IOI10_languages) C++
56 / 100
370 ms 2988 KB
#include <stdlib.h>
#include <stdio.h>
#include "grader.h"
#include "lang.h"

int counts[60][65540];

void excerpt(int *E)
{
	int i,j,similcnt,mxv=-1,mxp,ans;
	for(i=0;i<=55;++i)
	{
		similcnt=0;
		for(j=0;j<100;++j)if(counts[i][E[j]])similcnt++;
		if(similcnt>mxv)
		{
			mxv=similcnt;
			mxp=i;
		}
	}
	ans=language(mxp);
	for(i=0;i<100;++i)counts[ans][E[i]]=1;
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:21:5: warning: 'mxp' may be used uninitialized in this function [-Wmaybe-uninitialized]
  ans=language(mxp);
  ~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 310 ms 2988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 370 ms 2896 KB Output is partially correct - 52.92%