結果
| 問題 | No.2117 中国剰余定理入門 |
| コンテスト | |
| ユーザー |
O--O
|
| 提出日時 | 2022-11-04 21:23:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 631 bytes |
| コンパイル時間 | 1,288 ms |
| コンパイル使用メモリ | 167,020 KB |
| 実行使用メモリ | 16,952 KB |
| 最終ジャッジ日時 | 2024-07-18 19:05:48 |
| 合計ジャッジ時間 | 7,625 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(x) x.begin() , x.end()
#define pii pair<int , int>
#define pb emplace_back
#define F first
#define S second
const int mod = 1e9 + 7;
const int MAXX = 1e5 + 5;
int a , b , c , d;
signed main()
{
_FastIO;
cin >> b >> a >> d >> c;
if(a < 0)
a = b + a;
if(c < 0)
c = d + c;
for(int i = 0; i < mod; i++){
if((i % b == a) && (i % d == c)){
cout << i << endl;
return 0;
}
}
return 0;
}
O--O