結果
| 問題 |
No.413 +5,000,000pts
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-07 10:05:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 742 bytes |
| コンパイル時間 | 613 ms |
| コンパイル使用メモリ | 73,340 KB |
| 実行使用メモリ | 8,448 KB |
| 最終ジャッジ日時 | 2024-10-12 02:29:05 |
| 合計ジャッジ時間 | 13,190 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 |
ソースコード
// ConsoleApplication6.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include <iostream>
#include <algorithm>
#include <random>
using namespace std;
typedef long long ll;
ll calc(ll d) {
return (ll)((-1 + sqrt(1 + 4 * d)) / 2.0);
}
bool iscorrect(ll d) {
long ans = calc(d);
if (ans * ans + ans <= d && (ans + 1) * (ans + 1) + (ans + 1) > d) {
return true;
}
else
return false;
}
ll rand_big() {
return 10000000 + (ll)(rand() * (1000000000000000000 - 10000000 + 1.0) / (1.0 + RAND_MAX));
}
int main()
{
int count = 0;
while (true) {
ll d = rand_big();
while(!iscorrect(d)) {
cout << d;
count++;
d--;
if (count == 100000)return 0;
}
}
return 0;
}