結果
| 問題 | No.3498 Modulo Equation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-19 17:20:44 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,088 bytes |
| 記録 | |
| コンパイル時間 | 2,344 ms |
| コンパイル使用メモリ | 329,788 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-19 17:20:50 |
| 合計ジャッジ時間 | 3,584 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,a,b) for (int i=a; i<b; i++)
#define rrep(i,a,b) for(int i=a; i>=b; i--)
#define fore(i,a) for(auto &i:a)
#define pb push_back
#define _GLIBCXX_DEBUG
template <typename T> inline bool chmin(T& a, const T& b) {bool c=a>b; if(a>b) a=b; return c;}
template <typename T> inline bool chmax(T& a, const T& b) {bool c=a<b; if(a<b) a=b; return c;}
template <typename T> inline T gcd(T a,T b) {return (b==0)?a:gcd(b,a%b);}
template <typename T> inline T lcm(T a, T b) {return (a*b)/gcd(a,b);}
const int inf = INT_MAX / 2;
const ll infl = 1LL << 60;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a,b;
cin >> a >> b;
rep(i,1,100001){
if(i % a == b % i){
cout << i << endl;
break;
}
}
cout << fixed << setprecision(30);
return 0;
}