Language: C++


Home

    Problem
    Status
    Contest
    User
    Group
    Forum
    Article
    Logout
    _52hz

Have Fun
Begin: 2019-11-02 07:00 CST
图论和简单数据结构
End: 2019-11-05 07:00 CST
28:37:50
Elapsed: 28:37:50
Running
Remaining: 43:22:09

    Overview
    Problem
    Status
    Rank (28:37:45)
    1 Comments

Rank
	
Team
	
Score
	
Penalty
	
A
	
B
	
C
	
D
	
E
	
F
	
G
12 / 34
	
9 / 22
	
1 / 3
	
21 / 57
	
19 / 84
	
21 / 105
	
12 / 44
1	
Sionyyy (应智翔)
	6	1953 	08:09:28
(-1)	10:57:07
 	 	02:04:55
(-3)	01:04:35
 	04:22:29
(-3)	02:55:07
(-2)
2	
parsnip (胡心畅)
	6	2789 	11:24:36
 	10:26:37
 	 	04:06:14
(-2)	02:37:17
(-2)	03:07:45
(-3)	12:06:57
(-1)
3	
Dreadt (童培峻)
	6	2824 	12:27:12
 	08:26:15
 	 	03:56:55
(-1)	02:54:54
 	02:36:13
(-1)	13:22:48
(-8)
4	
lbwnb (lbw)
	6	3191 	12:17:14
(-2)	08:32:36
(-1)	 	06:55:33
(-1)	03:56:31
(-4)	04:21:38
 	13:08:12
(-4)
5	
zjh0709 (鸡你太美)
	6	3950 	13:47:21
 	12:58:02
(-1)	 	04:12:49
 	14:38:31
(-2)	04:13:00
 	14:20:51
(-2)
6	
yangjiuzhi (杨久知)
	6	4028 	12:44:25
 	03:34:46
(-10)	 	10:59:51
 	07:25:11
(-15)	09:40:54
(-4)	12:03:11
(-3)
7	
dsakhdkas (俞越)
	6	4318 	14:55:10
(-4)	07:41:53
(-1)	 	12:38:13
(-1)	06:24:33
(-6)	11:03:10
(-5)	13:35:56
 
8	
Pictures
	5	1249 	07:33:57
(-1)	 	 	02:16:57
 	01:22:07
(-1)	04:14:32
(-1)	03:21:54
(-3)
9	
Enkidu (lyh刘玥含)
	5	3093 	12:42:06
 	13:21:54
 	 	08:24:33
(-4)	06:55:05
(-1)	07:49:38
(-2)	(-1)
10	
2421594879 (郑权涌)
	5	3268 	 	14:54:48
 	 	06:42:52
(-2)	04:05:09
(-8)	08:29:16
(-10)	13:36:50
 
11	
d_j (丁杰)
	5	3818 	12:32:03
(-7)	 	 	10:12:10
 	10:35:48
(-11)	08:03:19
 	14:55:31
(-4)
12	
LHJKY (蒟蒻qt)
	4	1776 	12:27:46
(-1)	 	 	07:14:34
(-3)	03:42:18
(-1)	02:32:07
(-6)	 
13	
Centuryee (徐维蔓)
	4	2003 	 	 	 	08:10:59
 	04:14:19
 	07:40:47
(-1)	12:17:43
(-2)
14	
nzc (nzc)
	4	2343 	12:09:59
(-1)	 	 	08:19:10
(-1)	10:21:56
 	06:32:34
(-3)	 
15	
pigzhou (小周猪猪)
	3	727 	(-1)	 	 	04:24:16
(-1)	02:04:11
(-1)	03:58:38
(-3)	 
16	
zhuchangcheng (朱昶成)
	3	1468 	 	 	 	06:54:42
(-2)	11:13:05
(-3)	04:00:33
(-2)	 
17	
yangjiahan_2023 (杨佳涵)
	3	1639 	 	 	 	05:59:07
(-4)	09:34:00
(-7)	04:25:57
(-11)	 
18	
weihongyu (魏宏宇)
	3	1702 	 	 	 	04:11:31
 	08:16:11
(-3)	14:34:21
(-1)	 
19	
liuchengguo (刘成果)
	3	1710 	(-2)	 	 	06:59:22
(-2)	15:01:35
 	04:49:49
(-3)	 
20	
qyxpsx7 (潘舒钘)
	3	2412 	 	 	 	12:13:41
(-3)	 	07:39:36
(-15)	13:39:19
(-2)
21	
chushouTV (蔡徐坤)
	2	652 	 	 	 	03:47:22
(-3)	 	02:45:15
(-10)	 
22	
hzk_cpp (专业卖鱼100年)
	1	896 	 	 	14:16:02
(-2)	 	 	 	 
23	
Froggyzqy (Froggy)
	0	0 	(-2)	 	 	(-1)	 	 	 
24	
_52hz (_52hz)
	0	0 	 	 	 	(-2)	 	 	 
[Find me]
All Copyright Reserved © 2010-2019 Xu Han
Server Time: 2019-11-03 11:37:50 CST
_52hz (_52hz)'s submissions for problem D
RunID 	Status 	Memory 	Time 	Language 	Length 	Submit Time
22650645 	
Submitted
			
C++14 (GCC 5.3.0)
	971 	28:31:28
22650620 	
Runtime Error
			
Bash (GNU bash v4.3.11)
	971 	28:30:18
_52hz (_52hz)'s submissions for problem D
RunID 	Status 	Memory 	Time 	Language 	Length 	Submit Time
22650645 	
Submitted
			
C++14 (GCC 5.3.0)
	971 	28:31:28
22650620 	
Runtime Error
			
Bash (GNU bash v4.3.11)
	971 	28:30:18
#22650645 | _52hz's solution for [Problem D]
Status
	Wrong Answer
Length
	971
Lang
	C++14 (GCC 5.3.0)
Submitted
	2019-11-03 11:31:28
Shared
	
8.0 / 35.0
Select Code

#include <bits/stdc++.h>

typedef long long ll;
 
const int maxn = 1e5 + 10;
 
int f[maxn][11], cor[maxn];
int a[maxn], b[maxn], c[maxn];
int n, m, q, x, y;
 
std::vector <int> v[maxn];
 
void Work(int x, int y, int z){
	if (~f[x][y]) return;
	if (!cor[x]) cor[x] = z;
	if (y <= 0) return;
	for (auto u : v[x]){
		Work(u, y - 1, z);
	}
	f[x][y] = 1;
}

int read(){ int x = 0, ch = getchar(), f = 1; while(!isdigit(ch)){if(ch == '-')f = -1; ch = getchar();} while(isdigit(ch)){ x = x * 10 + ch - '0', ch = getchar();} return x * f; }
 
int main()
{
    // freopen(".in","r",stdin); freopen(".out","w",stdout);
    n = read(), m = read();
	for(int i = 1; i <= m; ++ i) x = read(), y = read(), v[x].push_back(y), v[y].push_back(x);
    q = read();
	for( int  i = 1; i <= n; ++ i ) a[i] = read(), b[i] = read(), c[i] = read();
	memset(f, -1, sizeof f);
	for( int i = q; i >= 1; i --) Work(a[i], b[i], c[i]);
	for(int i = 1; i <= n ; ++ i) printf("%d\n", cor[i]);
	return 0;
}

Preview:


Compiler output:
a.cc:21:18: error: invalid digit "9" in octal constant
   21 | Remaining: 43:22:09
      |                  ^~
a.cc:65:25: error: invalid digit "8" in octal constant
   65 |         6       1953    08:09:28
      |                         ^~
a.cc:65:28: error: invalid digit "9" in octal constant
   65 |         6       1953    08:09:28
      |                            ^~
a.cc:84:9: error: invalid digit "8" in octal constant
   84 |         08:26:15
      |         ^~
a.cc:93:9: error: invalid digit "8" in octal constant
   93 | (-2)    08:32:36
      |         ^~
a.cc:97:12: error: invalid digit "8" in octal constant
   97 |         13:08:12
      |            ^~
a.cc:114:9: error: invalid digit "9" in octal constant
  114 | (-15)   09:40:54
      |         ^~
a.cc:138:17: error: invalid digit "8" in octal constant
  138 |                 08:24:33
      |                 ^~
a.cc:146:15: error: invalid digit "9" in octal constant
  146 | (-2)    04:05:09
      |               ^~
a.cc:147:9: error: invalid digit "8" in octal constant
  147 | (-8)    08:29:16
      |         ^~
a.cc:155:9: error: invalid digit "8" in octal constant
  155 | (-11)   08:03:19
      |         ^~
a.cc:167:49: error: invalid digit "8" in octal constant
  167 |         4       2003                            08:10:59
      |                                                 ^~
a.cc:174:28: error: invalid digit "9" in octal constant
  174 |         4       2343    12:09:59
      |                            ^~
a.cc:175:25: error: invalid digit "8" in octal constant
  175 | (-1)                    08:19:10
      |                         ^~
a.cc:194:9: error: invalid digit "9" in octal constant
  194 | (-4)    09:34:00
      |         ^~
a.cc:200:9: error: invalid digit "8" in octal constant
  200 |         08:16:11
      |         ^~
a.cc:231:24: error: extended character © is not valid in an identifier
  231 | All Copyright Reserved © 2010-2019 Xu Han
      |                        ^
a.cc:233:14: warning: missing terminating ' character
  233 | _52hz (_52hz)'s submissions for problem D
      |              ^
a.cc:233:14: error: missing terminating ' character
  233 | _52hz (_52hz)'s submissions for problem D
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:238:12: error: too many decimal points in number
  238 | C++14 (GCC 5.3.0)
      |            ^~~~~
a.cc:243:18: error: too many decimal points in number
  243 | Bash (GNU bash v4.3.11)
      |                  ^~~~~
a.cc:245:14: warning: missing terminating ' character
  245 | _52hz (_52hz)'s submissions for problem D
      |              ^
a.cc:245:14: error: missing terminating ' character
  245 | _52hz (_52hz)'s submissions for problem D
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:250:12: error: too many decimal points in number
  250 | C++14 (GCC 5.3.0)
      |            ^~~~~
a.cc:255:18: error: too many decimal points in number
  255 | Bash (GNU bash v4.3.11)
      |                  ^~~~~
a.cc:257:11: error: "|" is not a valid filename
  257 | #22650645 | _52hz's solution for [Problem D]
      |           ^
a.cc:257:18: warning: missing terminating ' character
  257 | #22650645 | _52hz's solution for [Problem D]
      |                  ^
a.cc:263:20: error: too many decimal points in number
  263 |         C++14 (GCC 5.3.0)
      |                    ^~~~~
a.cc:2:1: error: 'Home' does not name a type
    2 | Home
      | ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:271:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
  164 |   __is_null_pointer(std::nullptr_t)
      |                                   ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
  159 |     __is_null_pointer(_Type)
      |     ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
  164 |   __is_null_pointer(std::nullptr_t)
      |                          ^~~~~~~~~
In file included from /usr/include/c++/14/cstddef:50,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
  443 |   typedef decltype(nullptr) nullptr_t;
      |                             ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
  666 |     struct is_null_pointer<std::nullptr_t>
      |                                 ^~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
  443 |   typedef decltype(nullptr) nullptr_t;
      |                             ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
  666 |     struct is_null_pointer<std::nullptr_t>
      |                                          ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
  670 |     struct is_null_pointer<const std::nullptr_t>
      |                                                ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
  674 |     struct is_null_pointer<volatile std::nullptr_t>
      |                                                   ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
  678 |     struct is_null_pointer<const volatile std::nullptr_t>
      |                                                         ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1429 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
 1429 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                                         ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1438 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
 1438 |     : public integral_constant<std::size_t, 0> { };
      |                                              ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
 1440 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
 1441 |     struct rank<_Tp[_Size]>
      |                     ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
 1441 |     struct rank<_Tp[_Size]>
      |                           ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1442 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
 1442 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1446 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
 1446 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
 2086 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
 2087 |     struct remove_extent<_Tp[_Size]>
      |                              ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
 2087 |     struct remove_extent<_Tp[_Size]>
      |                                    ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
 2099 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
 2100 |     struct remove_all_extents<_Tp[_Size]>
      |                                   ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
 2100 |     struct remove_all_extents<_Tp[_Size]>
      |                                         ^
/usr