提出 #40830234
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using mint = modint998244353;
int main() {
int N;
cin >> N;
string S;
cin >> S;
int x;
vector<int> y;
for (int i = 0; i < N; i++) {
if (S[i] == '|') y.push_back(i);
if (S[i] == '*') x = i;
}
if (y[0] < x && x < y[1])
cout << "in" << endl;
else
cout << "out" << endl;
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - Treasure Chest |
| ユーザ | mtrh |
| 言語 | C++ (GCC 9.2.1) |
| 得点 | 100 |
| コード長 | 496 Byte |
| 結果 | AC |
| 実行時間 | 7 ms |
| メモリ | 3660 KiB |
コンパイルエラー
./Main.cpp: In function ‘int main()’: ./Main.cpp:19:18: warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized] 19 | if (y[0] < x && x < y[1])
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_small03.txt, 01_small04.txt, 02_random_05.txt, 02_random_06.txt, 03_max_07.txt, 03_max_08.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 6 ms | 3448 KiB |
| 00_sample_01.txt | AC | 2 ms | 3548 KiB |
| 00_sample_02.txt | AC | 2 ms | 3444 KiB |
| 01_small03.txt | AC | 2 ms | 3628 KiB |
| 01_small04.txt | AC | 3 ms | 3628 KiB |
| 02_random_05.txt | AC | 2 ms | 3596 KiB |
| 02_random_06.txt | AC | 2 ms | 3464 KiB |
| 03_max_07.txt | AC | 2 ms | 3660 KiB |
| 03_max_08.txt | AC | 7 ms | 3512 KiB |