結果

問題 No.414 衝動
ユーザー albicillaalbicilla
提出日時 2016-10-05 23:53:08
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 1,274 ms
コンパイル使用メモリ 159,096 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 13:01:54
合計ジャッジ時間 2,591 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
6,944 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:11: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘ll*’ {aka ‘long long int*’} [-Wformat=]
   10 |   scanf("%d",&n);
      |          ~^  ~~
      |           |  |
      |           |  ll* {aka long long int*}
      |           int*
      |          %lld
main.cpp:26:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
   26 |   printf("%d %d\n",ans1,ans2);
      |           ~^       ~~~~
      |            |       |
      |            int     ll {aka long long int}
      |           %lld
main.cpp:26:15: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
   26 |   printf("%d %d\n",ans1,ans2);
      |              ~^         ~~~~
      |               |         |
      |               int       ll {aka long long int}
      |              %lld
main.cpp:10:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |   scanf("%d",&n);
      |   ~~~~~^~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

const ll MAX_N = 1000000000000;

int main(){
  ll n;
  scanf("%d",&n);
  ll ans1,ans2;
  ans1=1;ans2=n;
  bool flag;
  for(int i=2;i*i<=n;i++){
    if(n%i==0){
      ans1=i;
      ans2=n/i;
      flag=true;
      break;
    }
  }
  if(flag==false){
    ans1=1;
    ans2=n;
  }
  printf("%d %d\n",ans1,ans2);
  return 0;
}
0