結果

問題 No.2479 Sum of Squares
ユーザー nekoti
提出日時 2023-09-22 21:45:28
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 786 ms
コンパイル使用メモリ 30,208 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 12:30:04
合計ジャッジ時間 5,159 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other OLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

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