結果
| 問題 |
No.1162 Many Quotients hard
|
| ユーザー |
hiro71687k
|
| 提出日時 | 2024-02-12 04:27:45 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 921 ms / 2,000 ms |
| コード長 | 768 bytes |
| コンパイル時間 | 3,721 ms |
| コンパイル使用メモリ | 251,348 KB |
| 最終ジャッジ日時 | 2025-02-19 05:33:26 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 42 |
ソースコード
#include <bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
using namespace std;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll mod=998244353;
ll inf=1000000000000000001;//10^17
int main(){
ll now=1;
ll n;
cin >> n;
if (n==1)
{
cout << 1 << endl;
return 0;
}
if (n>500000000000000000)
{
now=500000000443288741;
for (ll i = 1414213562; i >=0; i++)
{
now+=i/2+1;
if (now>=n)
{
cout << i << endl;
return 0;
}
}
}
for (int i = 2; i >=0; i++)
{
now+=i/2+1;
if (now>=n)
{
cout << i << endl;
return 0;
}
}
}
hiro71687k