正文
增加 15 行删除 15 行
60 行未改动6162636465666768695 行未改动757677787980818283848586878889909192939495969798991001011021031041051061071088 行未改动1171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731749 行未改动60 行未改动for (int i = 1; i <= n; i ++ ){cin >> a[i];sum += a[i];}dp[0] = 1;pre[0][0] = {0, 0};for (int i = 1; i <= n; i ++ ){for (int j = sum / 2; j >= 0; j -- ){5 行未改动pre[i][j] = pre[i - 1][j];}}}if (sum % 2 == 0){if (dp[sum / 2]){pii now = {n, sum / 2};while (now.se){qwq.push_back(now.se - pre[now.fi][now.se].se);now = pre[now.fi][now.se];}for (auto i : qwq){for (int j = 1; j <= n; j ++ ){if (!vis[j] && a[j] == i){vis[j] = 1;break;}}}cout << "Second" << endl;while (1){int x, y;cin >> x;if (x == -1 || x == 0){return 0;}if (vis[x]){for (int j = 1; j <= n; j ++ ){if (!vis[j] && a[j] != 0){y = j;8 行未改动break;}}}cout << y << endl;int t = min(a[x], a[y]);a[x] -= t, a[y] -= t;}}else{cout << "First" << endl;while (1){int x, y;for (int j = 1; j <= n; j ++ ){if (a[j] != 0){x = j;break;}}cout << x << endl;cin >> y;if (y == -1 || y == 0){return 0;}int t = min(a[x], a[y]);a[x] -= t, a[y] -= t;}}}else{cout << "First" << endl;while (1){int x, y;for (int j = 1; j <= n; j ++ ){if (a[j] != 0){x = j;break;}}cout << x << endl;cin >> y;if (y == -1 || y == 0){return 0;}int t = min(a[x], a[y]);a[x] -= t, a[y] -= t;}}9 行未改动60 行未改动6162636465666768695 行未改动757677787980818283848586878889909192939495969798991001011021031041051061071088 行未改动1171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731749 行未改动60 行未改动for (int i = 1; i <= n; i ++ ){cin >> a[i];sum += a[i];}dp[0] = 1;pre[0][0] = {0, 0};for (int i = 1; i <= n; i ++ ){for (int j = sum / 2; j >= 0; j -- ){5 行未改动pre[i][j] = pre[i - 1][j];}}}if (sum % 2 == 0){if (dp[sum / 2]){pii now = {n, sum / 2};while (now.se){qwq.push_back(now.se - pre[now.fi][now.se].se);now = pre[now.fi][now.se];}for (auto i : qwq){for (int j = 1; j <= n; j ++ ){if (!vis[j] && a[j] == i){vis[j] = 1;break;}}}cout << "Second" << endl;while (1){int x, y;cin >> x;if (x == -1 || x == 0){return 0;}if (vis[x]){for (int j = 1; j <= n; j ++ ){if (!vis[j] && a[j] != 0){y = j;8 行未改动break;}}}cout << y << endl;int t = min(a[x], a[y]);a[x] -= t, a[y] -= t;}}else{cout << "First" << endl;while (1){int x, y;for (int j = 1; j <= n; j ++ ){if (a[j] != 0){x = j;break;}}cout << x << endl;cin >> y;if (y == -1 || y == 0){return 0;}int t = min(a[x], a[y]);a[x] -= t, a[y] -= t;}}}else{cout << "First" << endl;while (1){int x, y;for (int j = 1; j <= n; j ++ ){if (a[j] != 0){x = j;break;}}cout << x << endl;cin >> y;if (y == -1 || y == 0){return 0;}int t = min(a[x], a[y]);a[x] -= t, a[y] -= t;}}9 行未改动