結果
| 問題 | No.36 素数が嫌い! |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2015-08-10 04:42:31 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 5,000 ms |
| コード長 | 215 bytes |
| 記録 | |
| コンパイル時間 | 167 ms |
| コンパイル使用メモリ | 29,768 KB |
| 最終ジャッジ日時 | 2026-02-23 19:14:52 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
コンパイルメッセージ
main.c: In function ‘f’:
main.c:2:9: warning: incompatible implicit declaration of built-in function ‘sqrt’ [-Wbuiltin-declaration-mismatch]
2 | int i,j=sqrt(x);
| ^~~~
main.c:1:1: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’
+++ |+#include <math.h>
1 | long int f(long int x){
main.c: In function ‘main’:
main.c:13:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
13 | scanf("%ld",&a);
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | long int f(long int x){
ソースコード
long int f(long int x){
int i,j=sqrt(x);
if(x<3)return 0;
if(!(x%2))return x/2;
for(i=3;i<=j;i+=2){
if(!(x%i))return x/i;
}
return 0;
}
int main(){
long int a;
scanf("%ld",&a);
puts(f(f(a))?"YES":"NO");
return 0;
}
testestest