結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
hotpepsi
|
| 提出日時 | 2015-05-03 23:47:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 625 bytes |
| コンパイル時間 | 428 ms |
| コンパイル使用メモリ | 64,540 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 17:34:13 |
| 合計ジャッジ時間 | 1,040 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#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;
}
hotpepsi