結果
問題 |
No.1129 Rating じゃんけん
|
ユーザー |
|
提出日時 | 2020-12-30 02:49:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 649 bytes |
コンパイル時間 | 1,475 ms |
コンパイル使用メモリ | 167,272 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-06 09:28:41 |
合計ジャッジ時間 | 2,245 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr char newl = '\n'; // null wins: 1 // draw: 0 // tRue wins: -1 int janken(int b, int d) { if (b == d) return 0; if (b == 2 && d == 0) return 1; return (b < d ? 1 : -1); } int ratingJanken(int a, int b, int c, int d) { if (a != c) return (a > c ? 1 : -1); return janken(b, d); } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int a, b, c, d; cin >> a >> b >> c >> d; int res = ratingJanken(a, b, c, d); const char* winners[3] = {"tRue", "Draw", "null"}; cout << winners[res + 1] << newl; return 0; }