結果

問題 No.2479 Sum of Squares
ユーザー nekotinekoti
提出日時 2023-09-22 21:45:28
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 29,088 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-09-22 21:45:34
合計ジャッジ時間 4,325 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
8,756 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 WA -
testcase_03 OLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _DEBUG 0
#if _DEBUG
#endif

#include<stdio.h>
#include<math.h>
int main(void)
{
  int scan;//scanf警告用
  long long ans=0;
  long long i, j;
  
  long long s;scan=scanf("%lld",&s);
  long long t=s;
  long long n;
  int count=0;
  while(1)
  {
  	n=sqrt(s);
  	s-=n*n;count++;
  	if(s<100000000)break;
  }
  printf("%d\n",count+s);
  while(1)
  {
  	n=sqrt(t);
  	t-=n*n;
  	printf("%d ",n*n);
  	if(t<100000000)break;
  }
  while(t--)
  {
  	printf("1 ");
  }
  return 0;
}
0