Submission #1195319
Source Code Expand
/*He who forgives and acknowledges himself... that is what it truly means to be strong!*/
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <functional>
#include <list>
#include <deque>
#include <bitset>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <sstream>
#include <complex>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <climits>
#include <utility>
#include <ctime>
#include <tuple>
#include <fstream>
#define T int test_case; scanf("%d",&test_case); while(test_case--)
#define FOR(i,a,n) for(i=a;i<n;i++)
#define FORD(i,a,n) for(i=a;i>=n;i--)
#define FORS(i,a) for(i=0;a[i];i++)
#define si(x) scanf("%d",&x)
#define sc(x) cin>>x
#define sd(x) scanf("%lf",&x)
#define sll(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define prs(x) printf("%d ",x)
#define pls(x) printf("%lld ",x)
#define pc(x) printf("%c",x)
#define pi(x) printf("%d\n",x)
#define pd(x) cout.precision(10),cout<<fixed<<x<<endl;
#define pll(x) printf("%lld\n",x)
#define ps(x) printf("%s\n",x)
#define M 1000000007
#define ll long long
#define mp make_pair
#define all(x) x.begin(),x.end()
#define pb push_back
#define fr first
#define se second
#define in insert
#define er erase
#define pii pair<int, int>
#define plll pair<long long, long long>
#define tr(x,it) for(auto it : x)
#define INF 1ll<<60
#define PI 3.14159265358979323846264338327950288419716939937510582097494459230
#define bs(x,lo,hi,mid) cout<<x<<" "<<lo<<" "<<hi<<" "<<mid<<endl;
using namespace std;
ll gcd (ll a, ll b) {return ( a ? gcd(b%a, a) : b );}
ll power(ll a, ll n) {ll p = 1;while (n > 0) {if(n&1) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod) {ll p = 1;while (n > 0) {if(n&1) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}
vector<int> prime;
bool primee[10000000];
void primegen(ll x) { for(ll i=2;i*i<=x;i++) if(!primee[i]) for(ll j=i*i;j<=x;j+=i) primee[j]=true; for(ll i=2;i<=x;i++) if(!primee[i]) prime.push_back(i);}
const int N=100005;
vector<int> v[N];
int vi[N],co[N];
void dfs(int s,int cd,int d,int c)
{
vi[s]=1;
co[s]=c;
if(cd==d)
return;
int i;
FOR(i,0,v[s].size())
if(!vi[v[s][i]])
dfs(v[s][i],cd+1,d,c);
}
int main()
{
int i,j;
int n,m,q;
si(n);
si(m);
int x,y;
FOR(i,0,m)
{
si(x);
si(y);
v[x].pb(y);
v[y].pb(x);
}
int d,c;
si(q);
while(q--)
{
si(x);
si(d);
si(c);
dfs(x,0,d,c);
FOR(i,1,n+1)
vi[i]=0;
}
FOR(i,1,n+1)
pi(co[i]);
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Splatter Painting |
User |
aloochaat1998 |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
2781 Byte |
Status |
WA |
Exec Time |
2104 ms |
Memory |
9216 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:90:9: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(n);
^
./Main.cpp:91:9: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(m);
^
./Main.cpp:95:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(x);
^
./Main.cpp:96:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(y);
^
./Main.cpp:101:9: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
si(q);
^
./Main.cpp:104:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
...
Judge Result
Set Name |
Sample |
Subtask1 |
All |
Score / Max Score |
0 / 0 |
0 / 200 |
0 / 500 |
Status |
|
|
|
Set Name |
Test Cases |
Sample |
00_example_01.txt, 00_example_02.txt |
Subtask1 |
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 |
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 |
Case Name |
Status |
Exec Time |
Memory |
00_example_01.txt |
AC |
2 ms |
3584 KB |
00_example_02.txt |
AC |
2 ms |
3584 KB |
10_01.txt |
WA |
3 ms |
3584 KB |
10_02.txt |
AC |
2 ms |
3584 KB |
10_03.txt |
AC |
2 ms |
3584 KB |
10_04.txt |
AC |
2 ms |
3584 KB |
10_05.txt |
WA |
3 ms |
3584 KB |
10_06.txt |
AC |
2 ms |
3584 KB |
10_07.txt |
AC |
3 ms |
3584 KB |
10_08.txt |
WA |
7 ms |
3584 KB |
10_09.txt |
WA |
7 ms |
3584 KB |
10_10.txt |
WA |
7 ms |
3584 KB |
10_11.txt |
WA |
7 ms |
3584 KB |
10_12.txt |
WA |
7 ms |
3584 KB |
10_13.txt |
AC |
4 ms |
3584 KB |
10_14.txt |
AC |
3 ms |
3584 KB |
10_15.txt |
AC |
3 ms |
3584 KB |
10_16.txt |
AC |
28 ms |
3584 KB |
10_17.txt |
AC |
28 ms |
3584 KB |
20_01.txt |
TLE |
2103 ms |
9216 KB |
20_02.txt |
TLE |
2103 ms |
7168 KB |
20_03.txt |
TLE |
2104 ms |
7168 KB |
20_04.txt |
WA |
40 ms |
4224 KB |
20_05.txt |
WA |
9 ms |
3584 KB |
20_06.txt |
AC |
183 ms |
4480 KB |
20_07.txt |
WA |
8 ms |
3584 KB |
20_08.txt |
WA |
460 ms |
3712 KB |
20_09.txt |
WA |
6 ms |
3584 KB |
20_10.txt |
WA |
88 ms |
3584 KB |
20_11.txt |
WA |
845 ms |
3712 KB |
20_12.txt |
AC |
396 ms |
7424 KB |
20_13.txt |
TLE |
2103 ms |
7296 KB |
20_14.txt |
TLE |
2104 ms |
7168 KB |
20_15.txt |
TLE |
2104 ms |
7800 KB |
20_16.txt |
TLE |
2104 ms |
7800 KB |