結果
問題 |
No.2479 Sum of Squares
|
ユーザー |
![]() |
提出日時 | 2023-09-22 21:50:45 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 517 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 30,848 KB |
実行使用メモリ | 13,756 KB |
最終ジャッジ日時 | 2024-07-08 12:35:08 |
合計ジャッジ時間 | 3,763 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | TLE * 1 -- * 21 |
ソースコード
#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<400000)break; } printf("%d\n",count+s); while(1) { n=sqrt(t); t-=n*n; printf("%llu ",n*n); if(t<400000)break; } while(t--) { printf("1 "); } return 0; }