結果
| 問題 | No.201 yukicoderじゃんけん |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-08 22:32:59 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 693 bytes |
| 記録 | |
| コンパイル時間 | 492 ms |
| コンパイル使用メモリ | 99,464 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-10 14:31:29 |
| 合計ジャッジ時間 | 1,647 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <numeric>
using namespace std;
typedef long long int ll;
bool check(string a,string b){
if(a.size()>b.size())return true;
else if(a.size()<b.size())return false;
else{
int n=a.size();
for(int i=0;i<n;i++){
if(a[i]>b[i])return true;
else if(a[i]<b[i]) return false;
}
}
return true;
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
string s,t;
string a,b;
char c; cin >> s >> a >> c >> t >> b >> c;
if(a==b){
cout << -1 << endl;
}
else{
if(!check(a,b)){
cout << t << endl;
}
else{
cout << s << endl;
}
}
}