結果
問題 | No.3035 2018 |
ユーザー | tanzaku |
提出日時 | 2018-04-02 00:36:43 |
言語 | Java21 (openjdk 21) |
結果 |
TLE
|
実行時間 | - |
コード長 | 2,051 bytes |
コンパイル時間 | 2,148 ms |
コンパイル使用メモリ | 79,240 KB |
実行使用メモリ | 47,280 KB |
最終ジャッジ日時 | 2024-06-26 06:23:30 |
合計ジャッジ時間 | 6,180 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 126 ms
46,696 KB |
testcase_01 | AC | 131 ms
41,328 KB |
testcase_02 | AC | 131 ms
41,412 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
ソースコード
import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.Map.Entry; import java.util.Scanner; import java.util.TreeMap; public class Main { static int[] primeGap = new int[] {16, 28, 52, 84}; static int[] factorCount = new int[] {24,24,4,16,80,12,32,16,24,12,96,8,32,4,96,2,48,16,4,80,24,16,16,8,48,32,8,2,48,8,16,16,12,4,48,8,60,24,8,8,48,4,8,16,16,4,64,8,12,32,8,2,160,4,96,12,12,4,64,6,8,16,16,24,72,4,8,16,10,16,32,16,12,16,8,4,64,32,16,32,48,8,12,2,192,4,8,8,48,16,4,24,16,8,32,6,24,32,16,4}; void solveTestcase(final Scanner in, final PrintWriter out) { int n = in.nextInt(); for (int i = 1, j = 0; ; i++) { if (factorCount(i) == 4) { // dump(++j, i); if (++j == n) { out.println(i); return; } } } } void solve() { try (final PrintWriter out = new PrintWriter(System.out)) { try (final Scanner in = new Scanner(System.in)) { // int t = in.nextInt(); int t = 1; while (t-- > 0) { solveTestcase(in, out); } } } } public static void main(String[] args) { new Main().solve(); } // [l,r] boolean[] segmentSieve(long l, long r) { boolean[] res = new boolean[(int)(r-l+1)]; boolean[] small = new boolean[(int)Math.sqrt(r)+1]; Arrays.fill(res, true); Arrays.fill(small, true); if(l <= 1) res[0] = false; if(l <= 0) res[1] = false; for(int i = 2; (long)i*i <= r; i++) { if(small[i]) { if((long)i*i < small.length) { for(int j = i*i; j < small.length; j += i) { small[j] = false; } } { long v = (l + i - 1) / i * i; int j = (int)((v == i ? v + i : v) - l); for(; j < res.length; j += i) { res[j] = false; } } } } return res; } private static int factorCount(long t) { int res = 1; for(int i = 2; (long)i*i <= t; i++) { int cnt = 1; while(t % i == 0) { t /= i; cnt++; } res *= cnt; } if(t != 1) { res *= 2; } return res; } static void dump(Object...objects) { System.err.println(Arrays.deepToString(objects)); } }