結果
問題 |
No.201 yukicoderじゃんけん
|
ユーザー |
![]() |
提出日時 | 2015-05-03 23:45:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 625 bytes |
コンパイル時間 | 519 ms |
コンパイル使用メモリ | 65,260 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 17:31:56 |
合計ジャッジ時間 | 1,109 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 7 |
ソースコード
#include <iostream> #include <algorithm> #include <sstream> #include <vector> using namespace std; int main(int argc, char *argv[]) { string sa, sb, pa, pb, xa, xb; string s; getline(cin, s); stringstream ssa(s); ssa >> sa >> pa >> xa; getline(cin, s); stringstream ssb(s); ssb >> sb >> pb >> xb; int winner = 0; if (pa.length() > pb.length()) { winner = 1; } else if (pa.length() < pb.length()) { winner = 2; } else { int cmp = pa.compare(pb); if (cmp > 0) { winner = 1; } else if (cmp > 0) { winner = 2; } } string names[3] = { "-1", sa, sb }; cout << names[winner] << endl; return 0; }