提出 #72554732


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll n,m,l,s,t;
struct info{
	ll y,z;
};
vector<info> edge[200001];
bool tf[200001];
void dfs(ll x,ll h,ll r)
{
	if(r==l)
	{
		if(h>=s && h<=t)
			tf[x]=true;
		return;
	}
	for(auto i:edge[x])
	{
		if(!tf[i.y])
		{
			dfs(i.y,h+i.z,r+1);
		}
	}
}
int main()
{
	scanf("%lld%lld%lld%lld%lld",&n,&m,&l,&s,&t);
	memset(tf,false,sizeof(tf));
	for(int i=1;i<=m;i++)
	{
		ll x,y,z;
		scanf("%lld%lld%lld",&x,&y,&z);
		edge[x].push_back({y,z});
	}
	dfs(1,0,0);
	for(int i=1;i<=n;i++)
	{
		if(tf[i])
		{
			cout<<i<<" ";
		}
	}
	cout<<endl;
    return 0;
}

提出情報

提出日時
問題 D - Paid Walk
ユーザ roberun
言語 C++23 (Clang 21.1.0)
得点 0
コード長 656 Byte
結果 WA
実行時間 73 ms
メモリ 14284 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 400
結果
AC × 3
AC × 44
WA × 13
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, hand_20.txt, hand_21.txt, hand_22.txt, hand_23.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 3 ms 7932 KiB
example_01.txt AC 3 ms 7960 KiB
example_02.txt AC 3 ms 7880 KiB
hand_00.txt AC 46 ms 12264 KiB
hand_01.txt WA 50 ms 12304 KiB
hand_02.txt AC 52 ms 12364 KiB
hand_03.txt WA 55 ms 12304 KiB
hand_04.txt WA 50 ms 12304 KiB
hand_05.txt AC 40 ms 14252 KiB
hand_06.txt AC 3 ms 7848 KiB
hand_07.txt AC 6 ms 7896 KiB
hand_08.txt AC 47 ms 12436 KiB
hand_09.txt AC 46 ms 12332 KiB
hand_10.txt AC 3 ms 7912 KiB
hand_11.txt AC 3 ms 8056 KiB
hand_12.txt AC 41 ms 14096 KiB
hand_13.txt AC 40 ms 14284 KiB
hand_14.txt AC 35 ms 14284 KiB
hand_15.txt WA 40 ms 12720 KiB
hand_16.txt WA 50 ms 12216 KiB
hand_17.txt AC 46 ms 12208 KiB
hand_18.txt WA 44 ms 12384 KiB
hand_19.txt WA 44 ms 12320 KiB
hand_20.txt AC 46 ms 12224 KiB
hand_21.txt AC 44 ms 12176 KiB
hand_22.txt AC 50 ms 12364 KiB
hand_23.txt AC 73 ms 12436 KiB
random_00.txt AC 44 ms 13344 KiB
random_01.txt AC 46 ms 13388 KiB
random_02.txt AC 44 ms 13248 KiB
random_03.txt AC 44 ms 13260 KiB
random_04.txt AC 43 ms 13244 KiB
random_05.txt AC 43 ms 13356 KiB
random_06.txt AC 44 ms 12944 KiB
random_07.txt AC 46 ms 12952 KiB
random_08.txt AC 44 ms 13004 KiB
random_09.txt AC 45 ms 12860 KiB
random_10.txt AC 45 ms 12876 KiB
random_11.txt AC 45 ms 12840 KiB
random_12.txt WA 45 ms 12320 KiB
random_13.txt AC 51 ms 12304 KiB
random_14.txt WA 49 ms 12216 KiB
random_15.txt AC 53 ms 12248 KiB
random_16.txt AC 52 ms 12304 KiB
random_17.txt WA 45 ms 12320 KiB
random_18.txt WA 44 ms 12272 KiB
random_19.txt WA 44 ms 12304 KiB
random_20.txt AC 48 ms 12232 KiB
random_21.txt AC 44 ms 12408 KiB
random_22.txt AC 47 ms 12204 KiB
random_23.txt WA 43 ms 12364 KiB
random_24.txt AC 44 ms 13272 KiB
random_25.txt AC 44 ms 13356 KiB
random_26.txt AC 44 ms 13328 KiB
random_27.txt AC 44 ms 13336 KiB
random_28.txt AC 43 ms 13284 KiB
random_29.txt AC 43 ms 13328 KiB