답안 #115194

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
115194 2019-06-06T00:23:40 Z ly20 게임 (IOI14_game) C++14
0 / 100
2 ms 384 KB
#include<bits/stdc++.h>
using namespace std;
#include "game.h"
const int MAXN=1510,MAXL=13;
int v[MAXN][MAXN],v1[MAXL];
void initialize(int n)
{
	for(int i=1;i<=n;i++)
	{
		for(int j=i;j<=n;j++)
		{
			int k;
			for(int l=0;l<MAXL;l++)
			{
				if((1<<l)&j!=(1<<l)&i)
				{
					k=l;
					break;
				}
			}
			v1[k]++;
			v[i][j]=k;v[j][i]=k;
		}
	}
}
int hasEdge(int a,int b)
{
	if(v1[v[a][b]]==1)
	{
		return 1;
	}
	else 
	{
		v1[v[a][b]]--;
		return 0;
	}
}

Compilation message

game.cpp: In function 'void initialize(int)':
game.cpp:15:16: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
     if((1<<l)&j!=(1<<l)&i)
               ~^~~~~~~~
game.cpp:21:8: warning: 'k' may be used uninitialized in this function [-Wmaybe-uninitialized]
    v1[k]++;
    ~~~~^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -