結果

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

コンパイルメッセージ
main.cpp:25:15: エラー: ‘numeric_limits’ was not declared in this scope
   25 | const T INF = numeric_limits<T>::max();
      |               ^~~~~~~~~~~~~~
main.cpp:25:31: エラー: expected primary-expression before ‘>’ token
   25 | const T INF = numeric_limits<T>::max();
      |                               ^
main.cpp:25:37: エラー: ‘max()’ の呼び出しに適合する関数がありません
   25 | const T INF = numeric_limits<T>::max();
      |                                ~~~~~^~
次のファイルから読み込み:  /usr/local/gcc7/include/c++/12.2.0/string:50,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/bits/locale_classes.h:40,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/bits/ios_base.h:41,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/ios:42,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/ostream:38,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/iostream:39,
         次から読み込み:  main.cpp:2:
/usr/local/gcc7/include/c++/12.2.0/bits/stl_algobase.h:254:5: 備考: 候補: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/local/gcc7/include/c++/12.2.0/bits/stl_algobase.h:254:5: 備考:   template argument deduction/substitution failed:
main.cpp:25:37: 備考:   候補では 2 個の引数が予期されますが、0 個の引数が与えられています
   25 | const T INF = numeric_limits<T>::max();
      |                                ~~~~~^~
/usr/local/gcc7/include/c++/12.2.0/bits/stl_algobase.h:300:5: 備考: 候補: ‘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)
      |     ^~~
/usr/local/gcc7/include/c++/12.2.0/bits/stl_algobase.h:300:5: 備考:   template argument deduction/substitut

ソースコード

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