結果
問題 | No.854 公平なりんご分配 |
ユーザー | 6soukiti29 |
提出日時 | 2019-07-27 17:16:30 |
言語 | Nim (2.0.2) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,269 bytes |
コンパイル時間 | 3,418 ms |
コンパイル使用メモリ | 69,756 KB |
実行使用メモリ | 17,240 KB |
最終ジャッジ日時 | 2023-09-15 06:21:12 |
合計ジャッジ時間 | 8,663 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
4,380 KB |
testcase_01 | AC | 3 ms
4,380 KB |
testcase_02 | AC | 4 ms
4,432 KB |
testcase_03 | AC | 4 ms
4,380 KB |
testcase_04 | AC | 3 ms
4,420 KB |
testcase_05 | AC | 3 ms
4,384 KB |
testcase_06 | AC | 3 ms
4,380 KB |
testcase_07 | AC | 3 ms
4,380 KB |
testcase_08 | AC | 4 ms
4,384 KB |
testcase_09 | AC | 3 ms
4,384 KB |
testcase_10 | AC | 3 ms
4,428 KB |
testcase_11 | AC | 4 ms
4,384 KB |
testcase_12 | AC | 4 ms
4,464 KB |
testcase_13 | AC | 4 ms
4,648 KB |
testcase_14 | AC | 3 ms
4,384 KB |
testcase_15 | AC | 4 ms
4,380 KB |
testcase_16 | AC | 4 ms
4,564 KB |
testcase_17 | AC | 4 ms
4,500 KB |
testcase_18 | AC | 4 ms
4,444 KB |
testcase_19 | AC | 4 ms
4,508 KB |
testcase_20 | AC | 3 ms
4,400 KB |
testcase_21 | AC | 4 ms
4,580 KB |
testcase_22 | AC | 10 ms
5,024 KB |
testcase_23 | AC | 10 ms
5,736 KB |
testcase_24 | AC | 17 ms
6,592 KB |
testcase_25 | AC | 9 ms
5,528 KB |
testcase_26 | AC | 18 ms
6,688 KB |
testcase_27 | AC | 14 ms
6,748 KB |
testcase_28 | AC | 11 ms
4,808 KB |
testcase_29 | AC | 6 ms
4,904 KB |
testcase_30 | AC | 9 ms
5,296 KB |
testcase_31 | AC | 17 ms
6,384 KB |
testcase_32 | RE | - |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | AC | 139 ms
7,700 KB |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | RE | - |
testcase_42 | RE | - |
testcase_43 | RE | - |
testcase_44 | RE | - |
testcase_45 | RE | - |
testcase_46 | RE | - |
testcase_47 | RE | - |
testcase_48 | RE | - |
testcase_49 | RE | - |
testcase_50 | RE | - |
testcase_51 | RE | - |
testcase_52 | RE | - |
testcase_53 | RE | - |
testcase_54 | RE | - |
testcase_55 | RE | - |
testcase_56 | RE | - |
testcase_57 | RE | - |
testcase_58 | RE | - |
testcase_59 | RE | - |
testcase_60 | RE | - |
testcase_61 | WA | - |
testcase_62 | RE | - |
testcase_63 | RE | - |
testcase_64 | RE | - |
testcase_65 | RE | - |
testcase_66 | RE | - |
testcase_67 | RE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | RE | - |
testcase_72 | WA | - |
testcase_73 | RE | - |
testcase_74 | RE | - |
testcase_75 | RE | - |
testcase_76 | RE | - |
testcase_77 | RE | - |
testcase_78 | RE | - |
testcase_79 | RE | - |
testcase_80 | RE | - |
testcase_81 | RE | - |
testcase_82 | RE | - |
testcase_83 | RE | - |
testcase_84 | RE | - |
testcase_85 | RE | - |
testcase_86 | RE | - |
testcase_87 | RE | - |
testcase_88 | RE | - |
testcase_89 | RE | - |
testcase_90 | RE | - |
testcase_91 | RE | - |
testcase_92 | RE | - |
testcase_93 | RE | - |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 26) Warning: imported and not used: 'math' [UnusedImport] /home/judge/data/code/Main.nim(1, 31) Warning: imported and not used: 'algorithm' [UnusedImport]
ソースコード
import sequtils,strutils,math,algorithm var N = stdin.readline.parseInt zip : array[2005, int] unzip:array[304, int] A = stdin.readline.split.map(parseInt) primes = newSeq[int](0) isnotprime : array[2005, bool] S : array[350, array[-1..2005, int]] for i in 2..2000: if isnotprime[i]: continue var j = i * 2 while j <= 2000: isnotprime[j] = true j += i primes.add(i) #echo primes.len(),primes for i,p in primes: zip[p] = i unzip[i] = p var Q = stdin.readline.parseInt P,L,R : int for i,a in A: var k = a for j in primes: S[zip[j]][i] = S[zip[j]][i - 1] if a == 0: S[zip[j]][i] += 100 continue while k mod j == 0: S[zip[j]][i] += 1 k = k div j for q in 0..<Q: (P, L, R) = stdin.readline.split.map(parseInt) L -= 2 R -= 1 var f : bool = true var s : array[304, int] for j in 0..303: s[j] = S[j][R] - S[j][L] for p in primes: while P mod p == 0: P = P div p s[zip[p]] -= 1 if s[zip[p]] < 0: f = false if P > 1: f = false if f: echo "Yes" else: echo "NO"