結果
問題 | No.201 yukicoderじゃんけん |
ユーザー |
![]() |
提出日時 | 2016-03-05 09:03:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 545 bytes |
コンパイル時間 | 528 ms |
コンパイル使用メモリ | 60,508 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 14:14:30 |
合計ジャッジ時間 | 1,153 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include<iostream> #include<cmath> #include<string> using namespace std; #define WIN 1 #define DRAW 0 #define LOSE -1 int win_lose(string a,string b){ if(a.size()>b.size()) return WIN; else if(a.size()<b.size()) return LOSE; for(int i=0;i<a.size();i++){ if(a[i]<b[i]) return LOSE; else if(a[i]>b[i]) return WIN; } return DRAW; } int main(){ string SA,SB,PA,PB,XA,XB; int res; cin>>SA>>PA>>XA; cin>>SB>>PB>>XB; res=win_lose(PA,PB); if(res==DRAW) cout<<"-1"<<endl; else if(res==WIN) cout<<SA<<endl; else cout<<SB<<endl; }