提出 #75056870


ソースコード 拡げる

#include<bits/stdc++.h>
using namespace std;
int n,m;
vector<int> e[300005];
bool vis[300005];
int ans;
inline void dfs(int u){
    vis[u]=true;
    ans++;
    for(int v:e[u])
        if(!vis[v]) dfs(v);
}
signed main(void){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;++i){
        int a,b;
        scanf("%d%d",&a,&b);
        e[a].push_back(b);
    }
    dfs(1);
    printf("%d",ans);
}

提出情報

提出日時
問題 C - Straw Millionaire
ユーザ Chen_Zhen_DY
言語 C++23 (GCC 15.2.0)
得点 300
コード長 412 Byte
結果 AC
実行時間 95 ms
メモリ 25644 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 22
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 03_killer_00.txt, 03_killer_01.txt, 03_killer_02.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 2 ms 3804 KiB
00_sample_01.txt AC 2 ms 3676 KiB
00_sample_02.txt AC 2 ms 3824 KiB
01_handmade_00.txt AC 20 ms 5716 KiB
01_handmade_01.txt AC 20 ms 5720 KiB
01_handmade_02.txt AC 20 ms 5324 KiB
01_handmade_03.txt AC 24 ms 6384 KiB
01_handmade_04.txt AC 24 ms 5800 KiB
01_handmade_05.txt AC 88 ms 25644 KiB
01_handmade_06.txt AC 95 ms 25564 KiB
01_handmade_07.txt AC 56 ms 13908 KiB
01_handmade_08.txt AC 55 ms 13936 KiB
01_handmade_09.txt AC 20 ms 9784 KiB
02_random_00.txt AC 50 ms 17260 KiB
02_random_01.txt AC 33 ms 7140 KiB
02_random_02.txt AC 18 ms 5100 KiB
02_random_03.txt AC 39 ms 7228 KiB
02_random_04.txt AC 27 ms 5596 KiB
02_random_05.txt AC 26 ms 5792 KiB
03_killer_00.txt AC 30 ms 9832 KiB
03_killer_01.txt AC 29 ms 9808 KiB
03_killer_02.txt AC 39 ms 20444 KiB