結果
問題 | No.2558 中国剰余定理 |
ユーザー |
|
提出日時 | 2023-12-02 14:33:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 2,583 bytes |
コンパイル時間 | 1,081 ms |
コンパイル使用メモリ | 96,132 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 16:48:10 |
合計ジャッジ時間 | 1,841 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include<iostream>#include<string>#include<string.h>#include<algorithm>#include<vector>#include<tuple>#include<math.h>#include<numeric>#include<set>#include<climits>#include<map>#include<stack>#include<queue>#include <unordered_set>#include <algorithm>#include <climits>#include <cstdio>#include <set>#include <utility>////多分勝ちましたーwww////うえーい////using namespace std;typedef long long ll;typedef long double ld;using Graph = vector<vector<int>>;using vi = vector<int>;using vll = vector<long long>;using vs = vector<string>;using pii = pair<int, int>;using pll = pair<long long, long long>;template <typename T>bool chmax(T& a, const T& b) { if (a < b) { a = b;return true; }return false; }template <typename T>bool chmin(T& a, const T& b) { if (a > b) { a = b;return true; }return false; }#define YN(bool) if(bool){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}#define reps(i, a, n) for (int i = (a); i < (int)(n); ++i)#define rep(i, n) reps(i, 0, n)#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--)#define ALL(box) (box).begin(),(box).end()#define all(box) (box).begin(),(box).end()#define RALL(box) (box).rbegin(),(box).rend()#define ft first#define sd second#define pb push_back//#define mp make_pair#define pqueue priority_queue//sort(box.begin(), box.end());//sort(box.rbegin(), box.rend());//vector<vector<int>> box( a , vector<int>( a ));//printf("%.7Lf", n);//reverse(t.begin(), t.end());//auto It = lower_bound(ALL(box), n);以上 4//auto It = upper_bound(ALL(box), n);含まない上 7//cout << box.end() - It ; 末尾までの距離//cout << It - a.begin() ; 先頭までの距離//auto It =box.upper_bound( k);set,multiset// vector<vector<vector<bool>>> flag(350, vector<vector<bool>> 350, vector<bool,false>(350)));//pqueue < int, vector<int>, greater<int>> q;vector<vector<char>> migi(vector<vector<char>>& grid) {int N = grid.size();// 回転後の新しいグリッドを生成vector<vector<char>> rotatedGrid(N, vector<char>(N, 0));// 右に90度回転させる処理for (int i = 0; i < N; ++i) {for (int j = 0; j < N; ++j) {rotatedGrid[i][j] = grid[N - 1 - j][i];}}return rotatedGrid;}ll sum = 0;ll num = 0;int pum = 0;ll mum = 0;int min1 = 1000000001;int max1 = -2;ll min2 = 9223372036854775807;ll max2 = -10000000000000000;ll MOD1 = 1000000007;ll MOD = 998244353;int main() {int a, b, c, d;cin >> a >> b >> c >> d;rep(i, 3000 * 3000 + 100000) {if (i % a == c && i % b == d) {cout << i;return 0;}}}