結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2017-11-25 23:58:55 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 595 ms / 2,000 ms |
コード長 | 567 bytes |
コンパイル時間 | 142 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 21,760 KB |
最終ジャッジ日時 | 2024-11-15 12:18:11 |
合計ジャッジ時間 | 7,491 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
import mathN=int(input())#素数の表の作成n_sqrt = math.ceil(math.sqrt(N))isPrime = [True for i in range(n_sqrt+1)]primes = []primes.append(2)for i in range(4,n_sqrt+1,2):isPrime[i]=False#2if N%2==0:N=int(N/2)if N%2==0:if N%3==0:print(3)else:print(4)exit()#3以上for i in range(3,n_sqrt+1,2):if isPrime[i]==True:primes.append(i)if N%i==0:print(i)exit()for j in range(i+i,n_sqrt,i):isPrime[j]=Falseprint(N)