結果
| 問題 |
No.312 置換処理
|
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2016-04-03 02:03:14 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 360 bytes |
| コンパイル時間 | 338 ms |
| コンパイル使用メモリ | 23,552 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 12:33:05 |
| 合計ジャッジ時間 | 1,723 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 WA * 22 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%lld",&n);
| ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main(){
long long int n;
long long int i;
long long int sqarn;
long long int x,y;
int flag=0;
scanf("%lld",&n);
sqarn=sqrt(n);
for(i=2;i<=sqarn;i++){
if(n%i==0){
flag=1;
if(i==2)x=n/i;
else x=i;
}
}
if(!flag)printf("%lld\n",n);
else printf("%lld\n",x);
return 0;
}
notetonous