結果

問題 No.287 場合の数
ユーザー kotatsugamekotatsugame
提出日時 2020-02-27 20:37:07
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 705 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 77,940 KB
実行使用メモリ 9,184 KB
最終ジャッジ日時 2024-04-21 17:03:30
合計ジャッジ時間 2,077 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 27 ms
8,032 KB
testcase_04 AC 27 ms
8,416 KB
testcase_05 AC 19 ms
6,944 KB
testcase_06 AC 3 ms
6,940 KB
testcase_07 AC 9 ms
6,940 KB
testcase_08 AC 15 ms
6,944 KB
testcase_09 AC 19 ms
6,944 KB
testcase_10 AC 27 ms
9,184 KB
testcase_11 AC 7 ms
6,940 KB
testcase_12 AC 25 ms
9,056 KB
testcase_13 AC 5 ms
6,940 KB
testcase_14 AC 10 ms
6,944 KB
testcase_15 AC 19 ms
6,940 KB
testcase_16 AC 11 ms
6,940 KB
testcase_17 AC 24 ms
8,420 KB
testcase_18 AC 10 ms
6,940 KB
testcase_19 AC 21 ms
6,940 KB
testcase_20 AC 13 ms
6,944 KB
testcase_21 AC 19 ms
6,944 KB
testcase_22 AC 19 ms
6,940 KB
testcase_23 AC 16 ms
6,940 KB
testcase_24 AC 11 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
main()
{
	int N;cin>>N;
	vector<pair<int,long> >A;
	for(int i=0;i<=N;i++)A.push_back(make_pair(i,1L));
	for(int ccc=0;ccc<3;ccc++)
	{
		vector<pair<int,long> >B;
		for(int i=0;i<A.size();i++)for(int j=0;j<A.size();j++)
		{
			B.push_back(make_pair(A[i].first+A[j].first,A[i].second*A[j].second));
		}
		sort(B.begin(),B.end());
		long t=0;
		int pre=0;
		A.clear();
		for(pair<int,long>p:B)
		{
			if(pre<p.first)
			{
				A.push_back(make_pair(pre,t));
				t=0;
				pre=p.first;
			}
			t+=p.second;
		}
		A.push_back(make_pair(pre,t));
	}
	long ans=0;
	for(pair<int,long>p:A)if(p.first==6*N)ans+=p.second;
	cout<<ans<<endl;
}
0