P7912 100pts 队列 (used to be using vector, TLE)
This commit is contained in:
2024-10-21 21:41:32 +08:00
parent 8fc5fa15dd
commit b2505a5361
7 changed files with 119 additions and 31 deletions

View File

@@ -4,7 +4,7 @@ using namespace std;
#define mx 100100
int sum = 0;
int a[10][10];
int arr[10][10];
inline int read() {
char c = getchar();
if (c == '.')
@@ -84,7 +84,7 @@ struct dancing_link {
v = (ansk[i]) % 9;
if (v == 0)
v = 9;
a[x][y] = v;
arr[x][y] = v;
}
return 1;
}
@@ -112,7 +112,7 @@ int main() {
int o;
for (int i = 0; i <= 8; i++) {
for (int j = 0; j <= 8; j++) {
a[i][j] = x = read();
arr[i][j] = x = read();
for (int k = 1; k <= 9; k++) {
if (x != k && x != 0)
continue;
@@ -127,7 +127,7 @@ int main() {
dlx.dance(0);
for (int i = 0; i <= 8; i++) {
for (int j = 0; j <= 8; j++)
printf("%d", a[i][j]);
printf("%d", arr[i][j]);
printf("\n");
}
return 0;