結果
| 問題 | No.3498 Modulo Equation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-17 22:05:06 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,758 bytes |
| 記録 | |
| コンパイル時間 | 3,536 ms |
| コンパイル使用メモリ | 548,012 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-17 22:05:18 |
| 合計ジャッジ時間 | 4,680 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
namespace multip = boost::multiprecision;
using namespace std;
#define all(a) a.begin(),a.end()
#define pb push_back
#define sz(a) ((int)a.size())
#define vc_unique(v) v.erase(unique(v.begin(), vend()), v.end());
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
using ll = long long;
using lll = multip::int128_t;
using ld = long double;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
#define rep1(n) for(ll i=0; i<(ll)(n); ++i)
#define rrep(i, n) for(ll i=1; i<=(ll)(n); ++i)
#define rep2(i,n) for(ll i=0; i<(ll)(n); ++i)
#define rep3(i,a,b) for(ll i=(ll)(a); i<(ll)(b); ++i)
#define cut3(a,b,c,d,...) d
#define rep(...) cut3(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
template<typename T, typename S> bool chmin(T &a, const S b){if(a>b){a=b; return true;} return false;}
template<typename T, typename S> bool chmax(T &a, const S b){if(a<b){a=b; return true;} return false;}
template<typename T> istream& operator >> (istream& i, vector<T> &vec){for(auto &x: vec) i >> x; return i;}
template<typename T, typename S> istream& operator >> (istream& i, pair<T,S> &p){return i >> p.first >> p.second;}
void Yes(bool a){cout<<(a?"Yes":"No")<<"\n";}
void YES(bool a){cout<<(a?"YES":"NO")<<"\n";}
const ll INF = 2e18;
const ll MOD = 998244353;
void solve() {
int A, B; cin >> A >> B;
rep(1e6) {
if (i == 0) continue;
if(i % A == B % i) {
cout << i << endl;
return;
}
}
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
while(t--) {
solve();
}
return 0;
}