結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-08 22:32:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 693 bytes |
| コンパイル時間 | 835 ms |
| コンパイル使用メモリ | 85,344 KB |
| 最終ジャッジ日時 | 2025-01-11 00:14:53 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}
}