結果

問題 No.2119 一般化百五減算
ユーザー roarisroaris
提出日時 2022-11-04 22:47:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 600 bytes
コンパイル時間 4,340 ms
コンパイル使用メモリ 260,724 KB
実行使用メモリ 5,272 KB
最終ジャッジ日時 2023-09-26 01:16:47
合計ジャッジ時間 5,562 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 WA -
testcase_21 AC 17 ms
4,744 KB
testcase_22 WA -
testcase_23 AC 44 ms
4,956 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i, n) for (int i=0; i<n; i++)
#define pb push_back
typedef long long ll;

int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    
    int N, M; cin >> N >> M;
    vector<ll> rs, ms;
    rep(i, M) {
        ll Bi, Ci; cin >> Bi >> Ci;
        ms.pb(Bi);
        rs.pb(Ci);
    }
    
    pair<ll, ll> res = crt(rs, ms);
    if (res.first==0 && res.second==0) cout << "NaN" << endl;
    else {
        if (res.first>N) cout << "NaN" << endl;
        else cout << res.first << endl;
    }
}
0