結果
問題 | No.732 3PrimeCounting |
ユーザー | ああいい |
提出日時 | 2022-02-23 18:17:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 2,646 ms / 3,000 ms |
コード長 | 937 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 82,944 KB |
実行使用メモリ | 86,784 KB |
最終ジャッジ日時 | 2024-07-01 18:42:46 |
合計ジャッジ時間 | 34,333 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
51,968 KB |
testcase_01 | AC | 40 ms
51,840 KB |
testcase_02 | AC | 40 ms
51,584 KB |
testcase_03 | AC | 40 ms
51,840 KB |
testcase_04 | AC | 40 ms
52,096 KB |
testcase_05 | AC | 40 ms
51,584 KB |
testcase_06 | AC | 40 ms
51,968 KB |
testcase_07 | AC | 40 ms
51,840 KB |
testcase_08 | AC | 40 ms
51,456 KB |
testcase_09 | AC | 40 ms
51,840 KB |
testcase_10 | AC | 40 ms
51,968 KB |
testcase_11 | AC | 40 ms
51,456 KB |
testcase_12 | AC | 41 ms
51,840 KB |
testcase_13 | AC | 41 ms
51,328 KB |
testcase_14 | AC | 41 ms
51,968 KB |
testcase_15 | AC | 40 ms
52,096 KB |
testcase_16 | AC | 41 ms
51,840 KB |
testcase_17 | AC | 40 ms
51,584 KB |
testcase_18 | AC | 40 ms
51,840 KB |
testcase_19 | AC | 39 ms
51,840 KB |
testcase_20 | AC | 54 ms
60,672 KB |
testcase_21 | AC | 67 ms
65,536 KB |
testcase_22 | AC | 67 ms
65,408 KB |
testcase_23 | AC | 46 ms
58,368 KB |
testcase_24 | AC | 48 ms
58,368 KB |
testcase_25 | AC | 82 ms
69,888 KB |
testcase_26 | AC | 76 ms
68,736 KB |
testcase_27 | AC | 57 ms
62,720 KB |
testcase_28 | AC | 57 ms
63,104 KB |
testcase_29 | AC | 66 ms
64,896 KB |
testcase_30 | AC | 66 ms
65,792 KB |
testcase_31 | AC | 68 ms
66,048 KB |
testcase_32 | AC | 80 ms
70,016 KB |
testcase_33 | AC | 79 ms
69,632 KB |
testcase_34 | AC | 80 ms
69,376 KB |
testcase_35 | AC | 77 ms
69,248 KB |
testcase_36 | AC | 78 ms
69,248 KB |
testcase_37 | AC | 50 ms
59,520 KB |
testcase_38 | AC | 51 ms
59,520 KB |
testcase_39 | AC | 77 ms
69,632 KB |
testcase_40 | AC | 70 ms
65,920 KB |
testcase_41 | AC | 70 ms
66,048 KB |
testcase_42 | AC | 69 ms
65,792 KB |
testcase_43 | AC | 66 ms
65,280 KB |
testcase_44 | AC | 66 ms
65,536 KB |
testcase_45 | AC | 58 ms
63,232 KB |
testcase_46 | AC | 59 ms
63,232 KB |
testcase_47 | AC | 62 ms
63,872 KB |
testcase_48 | AC | 84 ms
70,016 KB |
testcase_49 | AC | 85 ms
70,144 KB |
testcase_50 | AC | 69 ms
65,920 KB |
testcase_51 | AC | 68 ms
65,664 KB |
testcase_52 | AC | 58 ms
62,592 KB |
testcase_53 | AC | 112 ms
71,168 KB |
testcase_54 | AC | 895 ms
78,848 KB |
testcase_55 | AC | 897 ms
79,104 KB |
testcase_56 | AC | 893 ms
78,848 KB |
testcase_57 | AC | 207 ms
73,600 KB |
testcase_58 | AC | 205 ms
73,472 KB |
testcase_59 | AC | 115 ms
71,296 KB |
testcase_60 | AC | 282 ms
74,112 KB |
testcase_61 | AC | 283 ms
73,856 KB |
testcase_62 | AC | 1,176 ms
80,768 KB |
testcase_63 | AC | 508 ms
77,056 KB |
testcase_64 | AC | 357 ms
74,880 KB |
testcase_65 | AC | 357 ms
75,648 KB |
testcase_66 | AC | 46 ms
58,496 KB |
testcase_67 | AC | 46 ms
58,112 KB |
testcase_68 | AC | 1,018 ms
79,744 KB |
testcase_69 | AC | 1,021 ms
79,488 KB |
testcase_70 | AC | 912 ms
78,976 KB |
testcase_71 | AC | 912 ms
78,720 KB |
testcase_72 | AC | 478 ms
76,416 KB |
testcase_73 | AC | 1,917 ms
83,840 KB |
testcase_74 | AC | 1,918 ms
84,480 KB |
testcase_75 | AC | 83 ms
69,632 KB |
testcase_76 | AC | 994 ms
80,000 KB |
testcase_77 | AC | 222 ms
73,088 KB |
testcase_78 | AC | 1,500 ms
82,176 KB |
testcase_79 | AC | 1,036 ms
80,256 KB |
testcase_80 | AC | 1,316 ms
81,152 KB |
testcase_81 | AC | 924 ms
79,360 KB |
testcase_82 | AC | 56 ms
61,440 KB |
testcase_83 | AC | 212 ms
73,728 KB |
testcase_84 | AC | 232 ms
73,472 KB |
testcase_85 | AC | 774 ms
77,952 KB |
testcase_86 | AC | 1,352 ms
81,408 KB |
testcase_87 | AC | 2,633 ms
86,784 KB |
testcase_88 | AC | 2,646 ms
86,016 KB |
ソースコード
N = int(input()) p1 = [] p2 = [] p = set() C = 3 * N+1 dat = [0] * C for i in range(2,C,2): dat[i] = 1 for i in range(3,C): if dat[i] == 0: if i <= N: if i % 3 == 1: p1.append(i) elif i % 3 == 2: p2.append(i) p.add(i) for j in range(i * 2,C,i): dat[j] = 1 dat = [0] * (2 * N) for i in range(len(p1)): for j in range(i + 1,len(p1)): dat[p1[i]+p1[j]] += 1 dat2 = [0] * C for i in p2: for j in range(20,2 * N,3): dat2[j+i] += dat[j] for j in range(20,2 * N,3): dat2[j+3] += dat[j] ans = 0 for v in p: ans += dat2[v] dat = [0] * (2 * N) dat2 = [0] * C for i in range(len(p2)): for j in range(i + 1,len(p2)): dat[p2[i]+p2[j]] += 1 for i in p1: for j in range(16,2 * N,3): dat2[i+j] += dat[j] for j in range(16,2 * N,3): dat2[j+3] += dat[j] for v in p: ans += dat2[v] print(ans)