結果

問題 No.2375 watasou and hibit's baseball
ユーザー 沙耶花沙耶花
提出日時 2023-07-10 18:12:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 925 bytes
コンパイル時間 4,850 ms
コンパイル使用メモリ 264,868 KB
実行使用メモリ 20,240 KB
最終ジャッジ日時 2023-10-10 01:15:02
合計ジャッジ時間 8,809 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 28 ms
10,916 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 112 ms
19,792 KB
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 11 ms
6,988 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 3 ms
4,352 KB
testcase_12 AC 47 ms
20,032 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 9 ms
5,044 KB
testcase_16 AC 5 ms
4,352 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 3 ms
4,352 KB
testcase_21 AC 44 ms
20,016 KB
testcase_22 AC 2 ms
4,352 KB
testcase_23 AC 43 ms
19,992 KB
testcase_24 AC 43 ms
19,988 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 63 ms
20,040 KB
testcase_29 AC 67 ms
20,032 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 72 ms
20,016 KB
testcase_34 WA -
testcase_35 AC 73 ms
20,024 KB
testcase_36 AC 68 ms
19,748 KB
testcase_37 AC 56 ms
19,992 KB
testcase_38 AC 43 ms
20,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001


int main(){
	
	int N,A,B;
	cin>>N>>A>>B;
	
	vector<int> x(N),y(N),K(N);
	rep(i,N){
		cin>>x[i]>>y[i]>>K[i];
	}
	
	vector dp(1<<N,vector(N,vector<bool>(N,false)));
	rep(i,N){
		dp[1<<i][i][i] = true;
	}
	rep(i,1<<N){
		rep(j,N){
			rep(k,N){
				if(dp[i][j][k]==false)continue;
				rep(l,N){
					if((i>>l)&1)continue;
					bool f = false;
					if(abs(K[k]-K[l])>=B)f = true;
					if(abs(x[k]-x[l]) + abs(y[k]-y[l]) + abs(x[j]-x[k]) + abs(y[j]-y[k]) >= A)f = true;
					if(f)dp[i|(1<<l)][k][l] = true;
				}
			}
		}
	}
	int ans = 1;
	rep(i,1<<N){
		rep(j,N){
			rep(k,N){
				if(dp[i][j][k])ans = max(ans,__builtin_popcount(i));
			}
		}
	}
	cout<<ans<<endl;
	
	return 0;
}
0