写了一段巨生草的代码哈哈哈哈wwwwwwww
|
|
真好用
题目 668 时钟
2016-07-02 10:12:10
|
|
枚举更慢、、、、
|
|
毛线啊时间这么长,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; } |