結果
問題 | No.3054 ほぼ直角二等辺三角形 |
ユーザー | kyort0n |
提出日時 | 2019-04-01 23:22:59 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,301 bytes |
コンパイル時間 | 1,902 ms |
コンパイル使用メモリ | 168,200 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-08-18 02:33:16 |
合計ジャッジ時間 | 3,376 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,376 KB |
testcase_06 | AC | 1 ms
4,380 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 1 ms
4,376 KB |
testcase_09 | AC | 1 ms
4,376 KB |
testcase_10 | AC | 1 ms
4,380 KB |
testcase_11 | AC | 2 ms
4,376 KB |
testcase_12 | AC | 1 ms
4,380 KB |
testcase_13 | AC | 2 ms
4,380 KB |
testcase_14 | AC | 2 ms
4,376 KB |
testcase_15 | AC | 1 ms
4,376 KB |
testcase_16 | AC | 2 ms
4,380 KB |
testcase_17 | AC | 2 ms
4,376 KB |
ソースコード
#include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.hpp> using namespace std; typedef long long ll; typedef pair<ll, ll> l_l; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) //const ll mod = 1000000007; typedef __int128 Lint; int main() { //cout.precision(10); cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; vector<Lint> c; c.push_back(-1); c.push_back(5); c.push_back(29); c.push_back(169); c.push_back(5741); c.push_back(33461); c.push_back(195025); c.push_back(1136689); c.push_back(38613965); c.push_back(225058681); c.push_back(1311738121); c.push_back(44560482149); c.push_back(259717522849); c.push_back(1513744654945); c.push_back(51422757785981); c.push_back(299713796309065); c.push_back(1746860020068409); c.push_back(59341817924539925); c.push_back(345869461223138161); //for(int i = 0; i < c.size(); i++) cout << c[i] << endl; Lint C = c[N]; Lint ok = 0; Lint ng = 1000000000000000000; while(ng - ok > 1) { Lint mid = (ok + ng) / 2; if(2 * mid * mid + 2 * mid + 1 <= C * C) ok = mid; else ng = mid; } cout << (long long)ok << " " << (long long)ok + 1 << " " << (long long)C << endl; return 0; }