結果
| 問題 |
No.537 ユーザーID
|
| コンテスト | |
| ユーザー |
tubo28
|
| 提出日時 | 2017-06-30 22:45:18 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 176 ms / 2,000 ms |
| コード長 | 607 bytes |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,800 KB |
| 最終ジャッジ日時 | 2024-10-04 20:43:34 |
| 合計ジャッジ時間 | 4,834 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'set'
$buf = []
def fill_buf; (s = gets) ? $buf = s.chomp.split : break while $buf.empty? end
def has_next; fill_buf; !$buf.empty? end
def get; fill_buf; $buf.shift end
def geti; get.to_i end
def getf; get.to_f end
def getss(n = nil); n ? Array.new(n) { get } : begin fill_buf; $buf.shift(1e9) end; end
def getis(n = nil); get_ss(n).map(&:to_i) end
def getfs(n = nil); get_ss(n).map(&:to_f) end
while has_next
n = geti
cand = Set.new
u = Math.sqrt(n+1).to_i
(1..u).select { |k| n % k == 0 }.each do |k|
cand << "#{k}#{n/k}"
cand << "#{n/k}#{k}"
end
# p cand
p cand.size
end
tubo28