結果
問題 |
No.2479 Sum of Squares
|
ユーザー |
|
提出日時 | 2023-11-29 22:11:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 388 bytes |
コンパイル時間 | 1,942 ms |
コンパイル使用メモリ | 196,116 KB |
最終ジャッジ日時 | 2025-02-18 02:25:12 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 21 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; int main(){ ll s; cin>>s; vector<ll> ans; while(s>0){ ll ok=0,ng=s+1; 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<<" "; } }