結果
問題 | No.201 yukicoderじゃんけん |
ユーザー |
![]() |
提出日時 | 2018-09-11 23:41:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 452 bytes |
コンパイル時間 | 438 ms |
コンパイル使用メモリ | 57,684 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 11:59:09 |
合計ジャッジ時間 | 1,288 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <iostream> #include <string> using namespace std; //文字列の要素はchar型なのでそのまま比較できる int main() { string sa,sb,pa,pb,xa,xb; cin >> sa >> pa >> xa >> sb >> pb >> xb; if(pa == pb) cout << -1 << endl; else if(pa.length() > pb.length()) cout << sa << endl; else if(pa.length() < pb.length()) cout << sb << endl; else cout << (pa > pb ? sa : sb) << endl; return 0; }