Submission #4914

# Submission time Handle Problem Language Result Execution time Memory
4914 2014-01-09T11:48:25 Z gs13068 보도블록 (KOI11_block) C++
13.2 / 22
0 ms 1088 KB
#include<cstdio>

int main()
{
	int i,j,n,m;
	scanf("%d%d",&n,&m);
	if(n&1)
	{
		if(m&1)
		{
		}
		else
		{
			printf("%d\n",2*n*m);
			for(i=m;i>=1;i--)printf("%d 1 1\n%d 1 0\n",i,i);
			for(i=1;i<=m;i++)
			{
				if(i&1)for(j=2;j<=n;j++)printf("%d %d 0\n%d %d 1\n",i,j,i,j);
				else for(j=n;j>=2;j--)
				{
					if(j&1)printf("%d %d 1\n%d %d 0\n",i,j,i,j);
					else printf("%d %d 0\n%d %d 1\n",i,j,i,j);
				}
			}
		}
	}
	else
	{
		printf("%d\n",2*n*m);
		for(i=n;i>=1;i--)printf("%d 1 1\n%d 1 0\n",i,i);
		for(i=1;i<=n;i++)
		{
			if(i&1)for(j=2;j<=m;j++)printf("%d %d 0\n%d %d 1\n",i,j,i,j);
			else for(j=m;j>=2;j--)
			{
				if(j&1)printf("%d %d 1\n%d %d 0\n",i,j,i,j);
				else printf("%d %d 0\n%d %d 1\n",i,j,i,j);
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct - 타일의 행 번호가 잘못되었습니다.
2 Correct 0 ms 1088 KB Output is correct
3 Incorrect 0 ms 1084 KB Output isn't correct - 첫째 줄에 K를 출력해야 합니다.
4 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Incorrect 0 ms 1088 KB Output isn't correct - 타일의 행 번호가 잘못되었습니다.
5 Incorrect 0 ms 1088 KB Output isn't correct - 타일의 행 번호가 잘못되었습니다.
6 Incorrect 0 ms 1088 KB Output isn't correct - 타일의 열 번호가 잘못되었습니다.
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
9 Correct 0 ms 1088 KB Output is correct
10 Correct 0 ms 1088 KB Output is correct
11 Correct 0 ms 1088 KB Output is correct
12 Correct 0 ms 1088 KB Output is correct
13 Incorrect 0 ms 1088 KB Output isn't correct - 타일의 열 번호가 잘못되었습니다.
14 Correct 0 ms 1088 KB Output is correct
15 Incorrect 0 ms 1088 KB Output isn't correct - 타일의 행 번호가 잘못되었습니다.
16 Incorrect 0 ms 1084 KB Output isn't correct - 첫째 줄에 K를 출력해야 합니다.