結果

問題 No.519 アイドルユニット
ユーザー kotatsugamekotatsugame
提出日時 2020-03-12 00:25:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 410 bytes
コンパイル時間 540 ms
コンパイル使用メモリ 67,868 KB
実行使用メモリ 69,120 KB
最終ジャッジ日時 2024-04-27 21:59:26
合計ジャッジ時間 11,045 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 AC 283 ms
19,712 KB
testcase_03 AC 18 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 3 ms
6,940 KB
testcase_10 AC 5 ms
6,940 KB
testcase_11 AC 17 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 18 ms
6,940 KB
testcase_14 AC 17 ms
6,944 KB
testcase_15 AC 17 ms
6,940 KB
testcase_16 AC 17 ms
6,940 KB
testcase_17 AC 18 ms
6,944 KB
testcase_18 AC 17 ms
6,940 KB
testcase_19 AC 17 ms
6,944 KB
testcase_20 AC 18 ms
6,940 KB
testcase_21 AC 17 ms
6,940 KB
testcase_22 AC 17 ms
6,944 KB
testcase_23 AC 18 ms
6,940 KB
testcase_24 AC 70 ms
7,552 KB
testcase_25 AC 70 ms
7,552 KB
testcase_26 AC 68 ms
7,552 KB
testcase_27 AC 68 ms
7,424 KB
testcase_28 AC 71 ms
7,424 KB
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
int N;
int F[24][24];
int dp[1<<24];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)for(int j=0;j<N;j++)cin>>F[i][j];
	for(int i=0;i<1<<N;i++)
	{
		for(int j=0;j<N;j++)
		{
			if(i>>j&1)continue;
			for(int k=j+1;k<N;k++)
			{
				if(i>>k&1)continue;
				dp[i|1<<j|1<<k]=max(dp[i|1<<j|1<<k],dp[i]+F[j][k]);
			}
			break;
		}
	}
	cout<<dp[(1<<N)-1]<<endl;
}
0