結果

問題 No.3054 ほぼ直角二等辺三角形
ユーザー kobaryo222kobaryo222
提出日時 2019-04-01 22:06:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 2,549 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 83,920 KB
最終ジャッジ日時 2024-11-14 21:23:45
合計ジャッジ時間 990 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp:25:15: error: 'numeric_limits' was not declared in this scope
   25 | const T INF = numeric_limits<T>::max();
      |               ^~~~~~~~~~~~~~
main.cpp:25:31: error: expected primary-expression before '>' token
   25 | const T INF = numeric_limits<T>::max();
      |                               ^
main.cpp:25:37: error: no matching function for call to 'max()'
   25 | const T INF = numeric_limits<T>::max();
      |                                ~~~~~^~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/string:50,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/locale_classes.h:40,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/ios_base.h:41,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ios:42,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:38,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iostream:39,
                 from main.cpp:2:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
main.cpp:25:37: note:   candidate expects 2 arguments, 0 provided
   25 | const T INF = numeric_limits<T>::max();
      |                                ~~~~~^~
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/in

ソースコード

diff #

#pragma region includes, macros
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>

using namespace std;
 
typedef long long i64;
typedef pair<i64, i64> P;

template<class T>
const T INF = numeric_limits<T>::max();
template<class T>
const T SINF = numeric_limits<T>::max() / 10;
static const i64 MOD = 1000000007;

//int dx[4] = {0,1,0,-1}, dy[4] = {-1,0,1,0};
//int dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
int dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//int dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

struct edge {
	i64 from, to, cost;
	edge(i64 to, i64 cost) : from(-1), to(to), cost(cost) {}
	edge(i64 src, i64 to, i64 cost) : from(src), to(to), cost(cost) {}
};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
	for(auto &e:t) fill_v(e,v);
}

#pragma endregion

int main(){
/* 	vector<i64> a(200), c(200);
	a[1] = 3;
	c[1] = 5;
	for(int i = 2; i < 100; ++i){
		a[i] = 3*a[i - 1] + 2*c[i-1]+1;
		c[i] = 4*a[i-1] + 3*c[i - 1] + 2;
		cout << a[i] << ", " << a[i] + 1 << ", " << c[i] << endl;
	}
	return 0; */
	i64 ans[19][3] = {{3, 4, 5}
	,{20, 21, 29}
	,{119, 120, 169}
	,{4059, 4060, 5741}
	,{23660, 23661, 33461}
	,{137903, 137904, 195025}
	,{803760, 803761, 1136689}
	,{27304196, 27304197,  38613965}
	,{159140519, 159140520, 225058681}
	,{927538920, 927538921, 1311738121}
	,{31509019100, 31509019101, 44560482149}
	,{183648021599, 183648021600,   259717522849}
	,{1070379110496, 1070379110497,   1513744654945}
	,{36361380737780, 36361380737781,   51422757785981}
	,{211929657785303, 211929657785304,   299713796309065}
	,{1235216565974040, 1235216565974041,       1746860020068409}
	,{7199369738058939, 7199369738058940,       10181446324101389}
	,{244566641436218639, 244566641436218640,   345869461223138161}
	,{1425438846754932240, 1425438846754932241, 2015874949414289041}};
	i64 x;
	cin >> x;
	--x;
	cout << ans[x][0] << " " << ans[x][1] << " " << ans[x][2] << endl;
}
0