Gravatar
lihaoze
积分:1315
提交:359 / 750
写了一段巨生草的代码哈哈哈哈wwwwwwww

题目 668 时钟 AAAAAAAA
2022-08-02 22:28:06
Gravatar
风间净无尘
积分:49
提交:23 / 48
真好用

题目 668 时钟
2016-07-02 10:12:10
Gravatar
ConanQZ
积分:708
提交:248 / 887
枚举更慢、、、、

题目 668 时钟 AAAAAAAA
2016-06-05 19:05:50
Gravatar
NVIDIA
积分:1171
提交:301 / 546
毛线啊时间这么长,BFS还是慢很多
下面是第一名的。。。。。。。。。这巨坑。
#include<cstdio>
const int A[9][9] =
{
{3, 3, 3, 3, 3, 2, 3, 2, 0},
{2, 3, 2, 3, 2, 3, 1, 0, 1},
{3, 3, 3, 2, 3, 3, 0, 2, 3},
{2, 3, 1, 3, 2, 0, 2, 3, 1},
{2, 3, 2, 3, 1, 3, 2, 3, 2},
{1, 3, 2, 0, 2, 3, 1, 3, 2},
{3, 2, 0, 3, 3, 2, 3, 3, 3},
{1, 0, 1, 3, 2, 3, 2, 3, 2},
{0, 2, 3, 2, 3, 3, 3, 3, 3}
};
int main()
{
freopen("clocks.in", "r", stdin);
freopen("clocks.out", "w", stdout);
int v[9] = {0}, i, j, k;
for (i = 0; i < 9; i++)
{
scanf("%d", &k);
for (j = 0; j < 9; j++) v[j] += (4 - k / 3) * A[i][j];
}
for (i = 0; i < 9; i++) v[i] &= 3;
k = 0;
for (i = 0; i < 9; i++)
for (j = 0; j < v[i]; j++)
if (!k) printf("%d", i + 1), k = 1;
else printf(" %d", i + 1);
putchar(10);
return 0;
}

题目 668 时钟 AAAAAAAA
2015-07-10 16:02:06