結果
| 問題 |
No.1129 Rating じゃんけん
|
| ユーザー |
|
| 提出日時 | 2020-09-12 21:15:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 678 bytes |
| コンパイル時間 | 1,943 ms |
| コンパイル使用メモリ | 207,304 KB |
| 最終ジャッジ日時 | 2025-01-14 13:44:35 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, ss, ee) for (int i = ss; i < ee; ++i)
using namespace std;
using Vi = vector<int>;
using VVi = vector<Vi>;
// RockPaperScissors
unsigned rps(unsigned p1, unsigned p2) {
VVi winner{{0, 1, 2}, {2, 0, 1}, {1, 2, 0}};
return winner[p1][p2];
}
// Winner
map<unsigned, string> winner{{0, "Draw"}, {1, "null"}, {2, "tRue"}};
void solve() {
string ans;
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a == c) {
ans = winner[rps(b, d)];
} else {
if (a > c)
ans = winner[1];
else
ans = winner[2];
}
cout << ans << endl;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
solve();
getchar();
}