結果
| 問題 |
No.413 +5,000,000pts
|
| ユーザー |
|
| 提出日時 | 2016-10-07 20:01:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 130 ms / 5,000 ms |
| コード長 | 604 bytes |
| コンパイル時間 | 528 ms |
| コンパイル使用メモリ | 68,408 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 19:53:49 |
| 合計ジャッジ時間 | 1,100 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <iostream>
#include <cmath>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
typedef long long ll;
using namespace std;
ll calc(ll d) {
return (ll)((-1 + sqrt(1 + 4*d)) / 2.0);
}
ll sq(ll x) { return x * x; }
bool check(ll t, ll d) {
return sq(t)+t <= d and sq(t+1)+(t+1) > d;
}
int main() {
const int n = 1e5;
ll t = 999999999;
for (int i = 0; i < n;) {
repeat (dd,100) {
ll d = sq(t)+t-dd;
if (check(calc(d), d)) continue;
cout << d << endl;
if (++ i >= n) break;
}
-- t;
}
return 0;
}