結果

問題 No.312 置換処理
ユーザー notetonous
提出日時 2016-04-03 01:47:14
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 23,296 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-02 12:32:47
合計ジャッジ時間 1,359 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |   ^~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>
int main(){
  long long int n;
  long long int i;
  long long int sn;
  long long int x,y;
  long long int ans;
  scanf("%lld",&n);
  sn=sqrt(n);
  for(i=1;i<=sn;i++){
    if(n%i==0){
      x=i;
      y=n/i;
    }
  }
  if(x<y){
    if(x>2){
      printf("%lld\n",x);
    }
    else printf("%lld\n",y);
  }

  return 0;
}
0