Submission #1194715
Source Code Expand
#include <bits/stdc++.h>
#define FI(i,a,b) for(int i=(a);i<=(b);i++)
#define FD(i,a,b) for(int i=(a);i>=(b);i--)
#define LL long long
#define Ldouble long double
#define PI 3.1415926535897932384626
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define mp make_pair
#define fi first
#define se second
using namespace std;
int n, m, q, val[11][100005];
int col[100005];
vector<int> v[100005];
int main(){
scanf("%d %d", &n, &m);
FI(i, 1, m){
int a, b;
scanf("%d %d", &a, &b);
v[a].push_back(b);
v[b].push_back(a);
}
scanf("%d", &q);
FI(i, 1, q){
int v, d, c;
scanf("%d %d %d", &v, &d, &c);
col[i] = c;
val[d][v] = i;
}
FD(i, 9, 0){
FI(j, 1, n){
val[i][j] = max(val[i][j], val[i + 1][j]);
for(auto to: v[j]){
val[i][j] = max(val[i][j], val[i + 1][to]);
}
}
}
FI(i, 1, n) printf("%d\n", col[val[0][i]]);
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Splatter Painting |
User |
alex20030190 |
Language |
C++14 (GCC 5.4.1) |
Score |
700 |
Code Size |
914 Byte |
Status |
AC |
Exec Time |
88 ms |
Memory |
11128 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:24:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &n, &m);
^
./Main.cpp:27:25: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &a, &b);
^
./Main.cpp:31:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &q);
^
./Main.cpp:34:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d", &v, &d, &c);
^
Judge Result
Set Name |
Sample |
Subtask1 |
All |
Score / Max Score |
0 / 0 |
200 / 200 |
500 / 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 |
3 ms |
6400 KB |
00_example_02.txt |
AC |
3 ms |
6400 KB |
10_01.txt |
AC |
3 ms |
6400 KB |
10_02.txt |
AC |
3 ms |
6400 KB |
10_03.txt |
AC |
3 ms |
6400 KB |
10_04.txt |
AC |
3 ms |
6400 KB |
10_05.txt |
AC |
3 ms |
6400 KB |
10_06.txt |
AC |
3 ms |
6400 KB |
10_07.txt |
AC |
3 ms |
6400 KB |
10_08.txt |
AC |
4 ms |
6528 KB |
10_09.txt |
AC |
4 ms |
6400 KB |
10_10.txt |
AC |
4 ms |
6400 KB |
10_11.txt |
AC |
4 ms |
6400 KB |
10_12.txt |
AC |
4 ms |
6528 KB |
10_13.txt |
AC |
4 ms |
6528 KB |
10_14.txt |
AC |
4 ms |
6528 KB |
10_15.txt |
AC |
4 ms |
6400 KB |
10_16.txt |
AC |
4 ms |
6528 KB |
10_17.txt |
AC |
4 ms |
6528 KB |
20_01.txt |
AC |
80 ms |
10496 KB |
20_02.txt |
AC |
88 ms |
10496 KB |
20_03.txt |
AC |
87 ms |
10496 KB |
20_04.txt |
AC |
16 ms |
7168 KB |
20_05.txt |
AC |
4 ms |
6400 KB |
20_06.txt |
AC |
14 ms |
7424 KB |
20_07.txt |
AC |
5 ms |
6400 KB |
20_08.txt |
AC |
19 ms |
6528 KB |
20_09.txt |
AC |
5 ms |
6400 KB |
20_10.txt |
AC |
18 ms |
6400 KB |
20_11.txt |
AC |
24 ms |
6528 KB |
20_12.txt |
AC |
54 ms |
10240 KB |
20_13.txt |
AC |
69 ms |
10624 KB |
20_14.txt |
AC |
72 ms |
10496 KB |
20_15.txt |
AC |
68 ms |
11000 KB |
20_16.txt |
AC |
67 ms |
11128 KB |