提出 #29733
ソースコード 拡げる
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <functional>
using namespace std;
#define REPN(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define REP(i, n) REPN(i, 0, n)
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
typedef pair<int, int> PII;
int main() {
int N;
scanf("%d", &N);
char mat[16][16];
int ex[16] = {0};
REP(i, N) REP(j, N) {
scanf(" %c ", &mat[i][j]);
ex[i] += (mat[i][j] == 'o' ? 3 : (i == j ? 1 : 0));
}
vector<PII> hand;
REP(i, N) hand.push_back(PII(ex[i], i + 1));
sort(ALL(hand), greater<PII>());
int wh = 0, lose_c = 0;
REP(i, 1000) {
printf("%d\n", hand[wh].second); fflush(stdout);
int x;
scanf("%d", &x);
if(mat[hand[wh].second - 1][x - 1] == 'x') lose_c ++;
if(lose_c >= 3) {
wh = 1 - wh;
lose_c = 0;
}
}
return 0;
}
提出情報
コンパイルエラー
./Main.cpp: In function ‘int main()’: ./Main.cpp:18:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] ./Main.cpp:24:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] ./Main.cpp:36:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
ジャッジ結果
| セット名 | All | ||||
|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 100 | ||||
| 結果 |
|
| セット名 | テストケース |
|---|---|
| All | 00_teuchi_00, 00_teuchi_01, 00_teuchi_02, 00_teuchi_03, 00_teuchi_04, 00_teuchi_05, 00_teuchi_06, 00_teuchi_07, 00_teuchi_08, 00_teuchi_09, 00_teuchi_10, 00_teuchi_11, 00_teuchi_12, 00_teuchi_13, 00_teuchi_14, 00_teuchi_15, 00_teuchi_16, 00_teuchi_17, 00_teuchi_18, 99_generated_0, 99_generated_1, 99_generated_10, 99_generated_11, 99_generated_12, 99_generated_13, 99_generated_14, 99_generated_15, 99_generated_16, 99_generated_17, 99_generated_2, 99_generated_3, 99_generated_4, 99_generated_5, 99_generated_6, 99_generated_7, 99_generated_8, 99_generated_9 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_teuchi_00 | TLE | 2030 ms | 1072 KiB |
| 00_teuchi_01 | TLE | 2030 ms | 1124 KiB |
| 00_teuchi_02 | TLE | 2030 ms | 1092 KiB |
| 00_teuchi_03 | TLE | 2030 ms | 1104 KiB |
| 00_teuchi_04 | TLE | 2030 ms | 1116 KiB |
| 00_teuchi_05 | TLE | 2030 ms | 1224 KiB |
| 00_teuchi_06 | TLE | 2029 ms | 1120 KiB |
| 00_teuchi_07 | TLE | 2029 ms | 1104 KiB |
| 00_teuchi_08 | TLE | 2032 ms | 1112 KiB |
| 00_teuchi_09 | TLE | 2030 ms | 1140 KiB |
| 00_teuchi_10 | TLE | 2030 ms | 1192 KiB |
| 00_teuchi_11 | TLE | 2029 ms | 1216 KiB |
| 00_teuchi_12 | TLE | 2030 ms | 1148 KiB |
| 00_teuchi_13 | TLE | 2030 ms | 1088 KiB |
| 00_teuchi_14 | TLE | 2030 ms | 1076 KiB |
| 00_teuchi_15 | TLE | 2030 ms | 1104 KiB |
| 00_teuchi_16 | TLE | 2031 ms | 1076 KiB |
| 00_teuchi_17 | RE | 0 ms | 1196 KiB |
| 00_teuchi_18 | TLE | 2029 ms | 1076 KiB |
| 99_generated_0 | TLE | 2030 ms | 1116 KiB |
| 99_generated_1 | TLE | 2030 ms | 1116 KiB |
| 99_generated_10 | TLE | 2030 ms | 1188 KiB |
| 99_generated_11 | RE | 0 ms | 1216 KiB |
| 99_generated_12 | TLE | 2030 ms | 1144 KiB |
| 99_generated_13 | TLE | 2030 ms | 1080 KiB |
| 99_generated_14 | TLE | 2030 ms | 1156 KiB |
| 99_generated_15 | TLE | 2030 ms | 1080 KiB |
| 99_generated_16 | TLE | 2030 ms | 1172 KiB |
| 99_generated_17 | TLE | 2030 ms | 1232 KiB |
| 99_generated_2 | TLE | 2029 ms | 1192 KiB |
| 99_generated_3 | TLE | 2029 ms | 1136 KiB |
| 99_generated_4 | TLE | 2030 ms | 1116 KiB |
| 99_generated_5 | TLE | 2030 ms | 1184 KiB |
| 99_generated_6 | TLE | 2030 ms | 1120 KiB |
| 99_generated_7 | TLE | 2030 ms | 1124 KiB |
| 99_generated_8 | TLE | 2030 ms | 1120 KiB |
| 99_generated_9 | TLE | 2029 ms | 1080 KiB |