AtCoder Grand Contest 012

Submission #1587975

Source codeソースコード

#include <iostream>
#include <vector>
using namespace std;
vector <int> v [100005];
bool visited[100005];

void DFS(int vertix,int colour,int distance,int longd){
    if(distance<=longd){
      visited[vertix]=true;
      v[vertix][0]=colour;
      for(int i=0;i<v[vertix][1];i++){
         if(visited[v[vertix][2+i]]==false){
             DFS(v[vertix][2+i],colour,distance+1,longd);
        }
    }
    }
}
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        v[i].push_back(0);
        v[i].push_back(0);
        visited[i]=false;
    }
    for(int i=0;i<m;i++){
        int x,y;
        cin>>x>>y;
        v[x].push_back(y);
        v[y].push_back(x);
        v[x][1]++;
        v[y][1]++;
    }
    int Q;
    cin>>Q;
    for(int i=0;i<Q;i++){
        int x,d,c;
        cin>>x>>d>>c;
        DFS(x,c,0,d);
        for(int i=1;i<=n;i++){
            visited[i]=false;
        }
    }
    for(int i=1;i<=n;i++){
        cout<<v[i][0]<<endl;
    }



    return 0;
}

Submission

Task問題 B - Splatter Painting
User nameユーザ名 vjudge5
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 993 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - 00_example_01.txt,00_example_02.txt
Subtask1 0 / 200 00_example_01.txt,00_example_02.txt,10_01.txt,10_02.txt,10_03.txt,10_04.txt,10_05.txt,10_06.txt,10_07.txt,10_08.txt,10_09.txt,10_10.txt,10_11.txt,10_12.txt,10_13.txt,10_14.txt,10_15.txt,10_16.txt,10_17.txt
All 0 / 500 00_example_01.txt,00_example_02.txt,10_01.txt,10_02.txt,10_03.txt,10_04.txt,10_05.txt,10_06.txt,10_07.txt,10_08.txt,10_09.txt,10_10.txt,10_11.txt,10_12.txt,10_13.txt,10_14.txt,10_15.txt,10_16.txt,10_17.txt,20_01.txt,20_02.txt,20_03.txt,20_04.txt,20_05.txt,20_06.txt,20_07.txt,20_08.txt,20_09.txt,20_10.txt,20_11.txt,20_12.txt,20_13.txt,20_14.txt,20_15.txt,20_16.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
00_example_01.txt AC 2 ms 2560 KB
00_example_02.txt AC 2 ms 2560 KB
10_01.txt WA
10_02.txt AC 3 ms 2560 KB
10_03.txt AC 2 ms 2560 KB
10_04.txt AC 3 ms 2560 KB
10_05.txt WA
10_06.txt AC 2 ms 2560 KB
10_07.txt AC 5 ms 2688 KB
10_08.txt WA
10_09.txt WA
10_10.txt WA
10_11.txt WA
10_12.txt WA
10_13.txt AC 7 ms 2688 KB
10_14.txt AC 7 ms 2688 KB
10_15.txt AC 7 ms 2688 KB
10_16.txt AC 34 ms 2688 KB
10_17.txt AC 35 ms 2688 KB
20_01.txt TLE
20_02.txt TLE
20_03.txt TLE
20_04.txt WA
20_05.txt WA
20_06.txt AC 326 ms 5888 KB
20_07.txt WA
20_08.txt TLE
20_09.txt WA
20_10.txt WA
20_11.txt TLE
20_12.txt AC 589 ms 6784 KB
20_13.txt TLE
20_14.txt TLE
20_15.txt TLE
20_16.txt TLE