結果
| 問題 |
No.2117 中国剰余定理入門
|
| コンテスト | |
| ユーザー |
ygd.
|
| 提出日時 | 2022-11-06 21:16:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 303 ms / 2,000 ms |
| コード長 | 788 bytes |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 60,928 KB |
| 最終ジャッジ日時 | 2024-07-20 08:47:08 |
| 合計ジャッジ時間 | 3,389 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import math
import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
from collections import defaultdict
#from collections import deque
import copy #DeepCopy: hoge = [_[:] for _ in hogehoge]
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]
def main():
b0,c0 = map(int,input().split())
b1,c1 = map(int,input().split())
for x in range(10000000):
if (x-c0)%b0 == 0 and (x-c1)%b1 == 0:
exit(print(x))
print('NaN')
if __name__ == '__main__':
main()
ygd.