結果
| 問題 | No.3498 Modulo Equation |
| コンテスト | |
| ユーザー |
aorinngo0606
|
| 提出日時 | 2026-04-17 20:21:28 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 421µs | |
| コード長 | 790 bytes |
| 記録 | |
| コンパイル時間 | 2,034 ms |
| コンパイル使用メモリ | 329,252 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-07 21:17:06 |
| 合計ジャッジ時間 | 4,141 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
typedef long long ll;
typedef long double lb;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define OVERLOAD_REP(_1, _2, _3, name, ...) name
#define REP1(i, n) for (auto i = std::decay_t<decltype(n)>{}; (i) != (n); ++(i))
#define REP2(i, l, r) for (auto i = (l); (i) != (r); ++(i))
#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__)
template<class T> bool chmin(T& a, const T& b){if(a > b){a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b){if(a < b){a = b; return 1;} return 0;}
const ll INF = 1000000000000000000; // 10^18
int main(){
ll a,b;
cin >> a >> b;
rep(i,100010){
if((i+1) % a == b % (i+1)){
cout << i+1 << endl;
return 0;
}
}
return 0;
}
aorinngo0606