結果
問題 |
No.632 穴埋め門松列
|
ユーザー |
|
提出日時 | 2018-01-19 21:50:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 724 bytes |
コンパイル時間 | 745 ms |
コンパイル使用メモリ | 70,916 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 12:29:56 |
合計ジャッジ時間 | 1,100 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> #include <string> using namespace std; bool is_kado(int a, int b, int c) { if (a == b || b == c || c == a) { return false; } if (a < b && b > c) { return true; } if (a > b && b < c) { return true; } return false; } bool check(string a, string b, string c, int n) { int x, y, z; x = a == "?" ? n : stoi(a); y = b == "?" ? n : stoi(b); z = c == "?" ? n : stoi(c); return is_kado(x, y, z); } int main() { string a, b, c; cin >> a >> b >> c; bool is1 = check(a, b, c, 1); bool is4 = check(a, b, c, 4); string ans; if (is1) { ans += "1"; } if (is4) { ans += "4"; } cout << ans << endl; return 0; }