結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-19 08:47:31 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 729 bytes |
| コンパイル時間 | 3,151 ms |
| コンパイル使用メモリ | 70,168 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 10:19:57 |
| 合計ジャッジ時間 | 4,270 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
import sequtils,strutils,algorithm,intsets
const F = [3, 5, 17, 257, 65537]
const G = (proc ():seq[int] =
var G = initIntSet()
for f in F : G.incl(f)
var glen = G.card
while true:
for g in toSeq(G.items):
for f in F:
if g mod f != 0 : G.incl(g * f)
if G.card == glen : break
glen = G.card
return 1 & toSeq(G.items).sorted(cmp)
)()
const H = (proc():seq[int] =
const INF = 1000000010
result = @[]
for i in 0..<100:
let n = 1 shl i
if n > INF : break
for g in G:
let gn = g * n
if gn > INF : continue
result &= g * n
return result.sorted(cmp)[2..^1]
)()
let n = stdin.readLine().parseInt()
for i,h in H:
if h <= n : continue
echo i
quit 0
echo H.len()