結果
| 問題 |
No.632 穴埋め門松列
|
| コンテスト | |
| ユーザー |
merom686
|
| 提出日時 | 2018-01-19 21:24:39 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 518 bytes |
| コンパイル時間 | 692 ms |
| コンパイル使用メモリ | 73,584 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 12:09:39 |
| 合計ジャッジ時間 | 1,133 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:22:14: warning: 'j' may be used uninitialized [-Wmaybe-uninitialized]
22 | c[j] = t;
| ~~~~~^~~
main.cpp:13:9: note: 'j' was declared here
13 | int j;
| ^
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main() {
char c[3];
int j;
for (int i = 0; i < 3; i++) {
cin >> c[i];
if (c[i] == '?') j = i;
}
string s;
for (int i = 0; i < 2; i++) {
char t = i == 0 ? '1' : '4';
c[j] = t;
if ((c[1] < c[0] && c[1] < c[2]) || (c[1] > c[0] && c[1] > c[2])) s += t;
}
cout << s << endl;
return 0;
}
merom686