結果
| 問題 | No.2119 一般化百五減算 |
| コンテスト | |
| ユーザー |
eve__fuyuki
|
| 提出日時 | 2024-05-07 01:22:09 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 519 bytes |
| 記録 | |
| コンパイル時間 | 1,210 ms |
| コンパイル使用メモリ | 215,816 KB |
| 実行使用メモリ | 11,928 KB |
| 最終ジャッジ日時 | 2026-07-04 16:43:28 |
| 合計ジャッジ時間 | 2,245 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 3 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/math>
using namespace std;
using namespace atcoder;
void fast_io() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
}
int main() {
fast_io();
int n, m;
cin >> n >> m;
vector<long long> b(m), c(m);
for (int i = 0; i < m; i++) {
cin >> b[i] >> c[i];
c[i] = (c[i] % b[i] + b[i]) % b[i];
}
auto [y, z] = crt(c, b);
if (z == 0 || y > n) {
cout << "NaN" << endl;
} else {
cout << y << endl;
}
}
eve__fuyuki