結果
問題 |
No.201 yukicoderじゃんけん
|
ユーザー |
![]() |
提出日時 | 2016-09-06 16:07:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 728 bytes |
コンパイル時間 | 637 ms |
コンパイル使用メモリ | 66,552 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 20:35:27 |
合計ジャッジ時間 | 1,421 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include<iostream> #include<algorithm> #include<stdio.h> #include<stdlib.h> #include<vector> #include<string> #include<sstream> #include<math.h> using namespace std; int main(){ string s[2]; string p[2]; string x[2]; cin >> s[0] >> p[0] >> x[0]; cin >> s[1] >> p[1] >> x[1]; if( p[0].size() > p[1].size() ){ cout << s[0] << endl; return 0; }else if( p[0].size() < p[1].size() ){ cout << s[1] << endl; return 0; }else{ for(int i=0; i<p[0].size(); i++){ if( p[0][i]-'0' > p[1][i]-'0' ){ cout << s[0] << endl; return 0; }else if( p[0][i]-'0' < p[1][i]-'0' ){ cout << s[1] << endl; return 0; } } } cout << -1 << endl; return 0; }