結果
| 問題 | No.1129 Rating じゃんけん |
| ユーザー |
|
| 提出日時 | 2020-09-12 21:15:43 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 857µs | |
| コード長 | 678 bytes |
| 記録 | |
| コンパイル時間 | 1,466 ms |
| コンパイル使用メモリ | 225,664 KB |
| 実行使用メモリ | 9,900 KB |
| 最終ジャッジ日時 | 2026-10-15 19:45:56 |
| 合計ジャッジ時間 | 3,362 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
#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();
}