結果

問題 No.2479 Sum of Squares
ユーザー twooimp
提出日時 2023-09-22 21:33:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
MLE  
実行時間 -
コード長 274 bytes
コンパイル時間 1,445 ms
コンパイル使用メモリ 169,988 KB
実行使用メモリ 814,236 KB
最終ジャッジ日時 2024-07-08 12:15:19
合計ジャッジ時間 4,330 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other MLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
  ll s;
  cin>>s;
  vector<ll> a;
  while(s){
    ll val=sqrt(s);
    s-=val*val;
    a.push_back(val*val);
  }
  cout<<a.size()<<endl;
  for(ll i=0;i<(ll)a.size();i++){
    cout<<a[i]<<" ";
  }
}
0