結果

問題 No.2479 Sum of Squares
ユーザー nekotinekoti
提出日時 2023-09-22 21:50:10
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 507 bytes
コンパイル時間 603 ms
コンパイル使用メモリ 29,392 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-22 21:50:18
合計ジャッジ時間 5,110 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 TLE -
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警告用
  unsigned long long ans=0;
  long long i, j;
  
  unsigned long long s;scan=scanf("%llu",&s);
  unsigned long long t=s;
  unsigned long long n;
  int count=0;
  while(1)
  {
  	n=sqrt(s);
  	s-=n*n;count++;
  	if(s<4)break;
  }
  printf("%d\n",count+s);
  while(1)
  {
  	n=sqrt(t);
  	t-=n*n;
  	printf("%llu ",n*n);
  	if(t<4)break;
  }
  while(t--)
  {
  	printf("1 ");
  }
  return 0;
}
0