結果
| 問題 |
No.2479 Sum of Squares
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-22 21:28:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 389 bytes |
| コンパイル時間 | 1,604 ms |
| コンパイル使用メモリ | 169,884 KB |
| 実行使用メモリ | 814,068 KB |
| 最終ジャッジ日時 | 2024-07-08 12:09:39 |
| 合計ジャッジ時間 | 3,992 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | MLE * 1 -- * 21 |
ソースコード
#include <bits/stdc++.h>
#include <math.h>
//ここから省略
#define yes (cout<<"Yes"<<endl)
#define no (cout<<"No"<<endl)
using namespace std;
int main(){
long long n;cin>>n;
long long a=sqrt(n);
vector<int> b;
for(int i=a;i>0;i--){
while(n>=i*i){
b.push_back(i*i);
n-=i*i;
}
//cout<<n<<endl;
}
cout<<b.size()<<endl;
for(int x:b)cout<<x<<' ';
cout<<endl;
}