結果
問題 |
No.2479 Sum of Squares
|
ユーザー |
|
提出日時 | 2023-09-22 21:36:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 411 bytes |
コンパイル時間 | 1,516 ms |
コンパイル使用メモリ | 169,340 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-08 12:20:44 |
合計ジャッジ時間 | 15,013 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 22 |
ソースコード
#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,a;cin>>n; vector<long long> b;a=sqrt(n); for(long long i=a;i>0;i--){ while(n>=i*i){ b.push_back(i*i); n-=i*i; } if(n==0)break; //cout<<n<<endl; } cout<<b.size()<<endl; for(int x:b)cout<<x<<' '; cout<<endl; }