結果
| 問題 | No.2479 Sum of Squares |
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2023-09-22 21:23:37 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 583 bytes |
| 記録 | |
| コンパイル時間 | 2,921 ms |
| コンパイル使用メモリ | 274,608 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-02 12:00:52 |
| 合計ジャッジ時間 | 18,380 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 TLE * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
int main()
{
int64_t s;
cin >> s;
vector<int64_t> as;
int64_t x = 1;
while ((x + 1) * (x + 1) <= s)
{
x++;
}
while (0 < s)
{
while (x * x <= s)
{
as.push_back(x * x);
s -= x * x;
}
x--;
}
cout << as.size() << endl;
for (auto &&a : as)
{
cout << a << ' ';
}
cout << endl;
return 0;
}
ldsyb