結果
問題 |
No.2479 Sum of Squares
|
ユーザー |
|
提出日時 | 2023-11-29 22:14:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 387 bytes |
コンパイル時間 | 1,892 ms |
コンパイル使用メモリ | 194,740 KB |
最終ジャッジ日時 | 2025-02-18 02:25:36 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 -- * 2 |
other | -- * 22 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; int main(){ ll s; cin>>s; vector<ll> ans; while(s){ ll ok=0,ng=1e18; while(abs(ok-ng)>1){ ll mid=(ok+ng)/2; if(mid*mid<=s){ ok=mid; }else{ ng=mid; } } s-=ok*ok; ans.push_back(ok*ok); } cout<<ans.size()<<endl; for(ll u:ans){ cout<<u<<" "; } }