結果
問題 |
No.201 yukicoderじゃんけん
|
ユーザー |
![]() |
提出日時 | 2018-03-04 23:33:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 823 bytes |
コンパイル時間 | 497 ms |
コンパイル使用メモリ | 70,160 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-17 23:06:32 |
合計ジャッジ時間 | 1,260 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
// No.201 yukicoderじゃんけん // https://yukicoder.me/problems/no/201 // #include <iostream> #include <vector> #include <string> using namespace std; string solve(vector<string> &p1, vector<string> &p2); int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); vector<string> p1(3); vector<string> p2(3); cin >> p1[0]; cin >> p1[1]; cin >> p1[2]; cin >> p2[0]; cin >> p2[1]; cin >> p2[2]; string ans = solve(p1, p2); cout << ans << endl; } string solve(vector<string> &p1, vector<string> &p2) { if (p1[1].size() > p2[1].size()) return p1[0]; else if (p1[1].size() < p2[1].size()) return p2[0]; else if (p1[1] > p2[1]) return p1[0]; else if (p1[1] < p2[1]) return p2[0]; else return "-1"; }