結果

問題 No.1129 Rating じゃんけん
ユーザー babumideepbabumideep
提出日時 2020-08-03 22:40:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,552 bytes
コンパイル時間 2,102 ms
コンパイル使用メモリ 204,176 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 18:43:09
合計ジャッジ時間 2,879 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,352 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 1 ms
4,352 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
#define pi (acos(-1))
using namespace std;
std::vector<unsigned ll> genprimevec(const unsigned ll N);
int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a != c)
    {
        if (a > c)
        {
            cout << "null" << endl;
            return 0;
        }
        cout << "tRue" << endl;
        return 0;
    }
    if (a == c && b != d)
    {
        if (b == 0 && d == 1)
        {
            cout << "null" << endl;
            return 0;
        }
        if (b == 1 && d == 2)
        {
            cout << "null" << endl;
            return 0;
        }
        if (b == 2 && d == 0)
        {
            cout << "null" << endl;
            return 0;
        }
        cout << "tRue" << endl;
        return 0;
    }
    if (a == c && b == d) { cout << "Draw" << endl; }
    // ugly but okay
    return 0;
}

/*author  https://qiita.com/drken/items/0c88a37eec520f82b788*/
ll extgcd(ll a, ll b, ll &x, ll &y)
{
    if (b == 0)
    {
        x = 1, y = 0;
        return a;
    }
    ll d = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return d;
}


std::vector<unsigned ll> genprimevec(const unsigned ll N)
{
    std::vector<bool> is_prime(N + 1);
    for (unsigned ll i = 0; i <= N; i++) { is_prime[i] = true; }
    std::vector<unsigned ll> P;
    for (unsigned ll i = 2; i <= N; i++)
    {
        if (is_prime[i])
        {
            for (unsigned ll j = 2 * i; j <= N; j += i) { is_prime[j] = false; }
            P.emplace_back(i);
        }
    }
    return P;
}
0