結果
問題 |
No.201 yukicoderじゃんけん
|
ユーザー |
![]() |
提出日時 | 2015-05-03 23:29:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 625 bytes |
コンパイル時間 | 436 ms |
コンパイル使用メモリ | 64,676 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-05 16:46:04 |
合計ジャッジ時間 | 1,051 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 { switch (pa.compare(pb)) { case 1: winner = 1; break; case -1: winner = 2; break; } } string names[3] = { "-1", sa, sb }; cout << names[winner] << endl; return 0; }