結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
neko_the_shadow
|
| 提出日時 | 2019-05-20 18:00:32 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 124 ms / 2,000 ms |
| コード長 | 752 bytes |
| コンパイル時間 | 2,296 ms |
| コンパイル使用メモリ | 73,620 KB |
| 実行使用メモリ | 41,696 KB |
| 最終ジャッジ日時 | 2024-09-17 06:41:20 |
| 合計ジャッジ時間 | 6,510 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
long a = stdin.nextInt();
int count = 0;
long[] primes = new long[] {3, 5, 17, 257, 65537}; // フェルマー素数
for (long bit = 0, len = primes.length; bit < (1 << len); bit++) {
long x = 1;
for (int i = 0; i < len; i++) {
if ((bit & (1 << i)) != 0) {
x *= primes[i];
}
}
while (x <= a) {
if (x >= 3) {
count++;
}
x *= 2;
}
}
System.out.println(count);
}
}
neko_the_shadow