結果
問題 |
No.2119 一般化百五減算
|
ユーザー |
|
提出日時 | 2022-11-04 22:47:10 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 600 bytes |
コンパイル時間 | 4,287 ms |
コンパイル使用メモリ | 251,460 KB |
最終ジャッジ日時 | 2025-02-08 18:10:48 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 3 |
ソースコード
#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; } }