結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-12 03:10:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 801 bytes |
| コンパイル時間 | 2,026 ms |
| コンパイル使用メモリ | 194,240 KB |
| 最終ジャッジ日時 | 2025-01-20 16:14:42 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
bool is_integer(double x){
return floor(x) == x;
}
int main(){
string sa,sb,pa,pb,xa,xb;
cin >> sa >> pa >> xa;
cin >> sb >> pb >> xb;
string winner = "";
auto comp = [&]() -> bool {
int na = pa.size(),nb = pb.size();
if(na > nb){
winner = sa;
return true;
}else if(na < nb){
winner = sb;
return true;
}else{
for(int i=na;i >= 0;i--){
if(pa[i] > pb[i]) winner = sa;
else if(pa[i] < pb[i]) winner = sb;
else continue;
}
if(winner == "") return false;
return true;
}
};
cout << (comp() ? winner : "-1") << endl;
}