結果

問題 No.2558 中国剰余定理
ユーザー k82bk82b
提出日時 2023-12-02 14:32:37
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 777 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 163,032 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 14:33:23
合計ジャッジ時間 3,251 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 7 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 26 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 7 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 3 ms
6,676 KB
testcase_11 AC 4 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 7 ms
6,676 KB
testcase_17 AC 1 ms
6,676 KB
testcase_18 AC 8 ms
6,676 KB
testcase_19 AC 11 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 5 ms
6,676 KB
testcase_22 AC 1 ms
6,676 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 9 ms
6,676 KB
testcase_25 AC 8 ms
6,676 KB
testcase_26 AC 2 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 7 ms
6,676 KB
testcase_29 AC 1 ms
6,676 KB
testcase_30 AC 3 ms
6,676 KB
testcase_31 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std, core.bitop;
string[] _R;
void readM(T)(ref T x) { while (_R.empty) { _R = readln.chomp.split; } x = _R.front.to!T; _R.popFront; }
bool chmin(T)(ref T A, T B) { return (A > B ? A = B, true : false); }
bool chmax(T)(ref T A, T B) { return (A < B ? A = B, true : false); }
int lowerBound(T)(T[] A, T x) { int lo = -1, hi = cast(int)(A.length); while (hi - lo > 1) { int mid = lo + hi >> 1; (A[mid] < x ? lo : hi) = mid; } return hi; }
int upperBound(T)(T[] A, T x) { int lo = -1, hi = cast(int)(A.length); while (hi - lo > 1) { int mid = lo + hi >> 1; (A[mid] > x ? hi : lo) = mid; } return hi; }

void main() {
	int A, B, a, b;
	A.readM;
	B.readM;
	a.readM;
	b.readM;
	foreach (i; 0 .. (10 ^^ 9)) {
		if (i % A == a && i % B == b) {
			writeln(i);
			break;
		}
	}
}
0