結果
| 問題 |
No.201 yukicoderじゃんけん
|
| コンテスト | |
| ユーザー |
kakira9618
|
| 提出日時 | 2015-05-03 23:28:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,124 bytes |
| コンパイル時間 | 551 ms |
| コンパイル使用メモリ | 89,236 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 16:42:00 |
| 合計ジャッジ時間 | 1,177 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cctype>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <memory>
#include <functional>
using namespace std;
int isbig(string score1, string score2) {
if (score1.size() > score2.size()) return 1;
if (score2.size() > score1.size()) return -1;
for (int i = 0; i < score1.size(); i++) {
if (score1[i] > score2[i]) {
return 1;
} else if (score2[i] > score1[i]) {
return -1;
}
}
return 0;
}
int main(int argc, char const *argv[]) {
string name1, name2, score1, score2, temp;
cin >> name1;
cin >> score1;
cin >> temp;
cin >> name2;
cin >> score2;
int r = isbig(score1, score2);
if (r == 1) {
cout << name1 << endl;
} else if (r == 0) {
cout << "-1" << endl;
} else {
cout << name2 << endl;
}
return 0;
}
kakira9618