結果
問題 |
No.414 衝動
|
ユーザー |
|
提出日時 | 2016-09-15 22:14:22 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 1,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 139 ms |
コンパイル使用メモリ | 23,552 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 03:11:43 |
合計ジャッジ時間 | 913 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%lld",&p); | ^~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>/*掛け算の衝動*/ #include<math.h> int main(){ int i,flag=0; long long p; scanf("%lld",&p); if(p%2 == 0){ printf("2 %lld\n",p/2); flag++; } else{ for(i=3;i<=sqrt(p);i=i+2){ if(p%i == 0){ printf("%d %lld\n",i,p/i); flag++; break; } } } if(flag == 0) printf("1 %lld\n",p); return 0; }