File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ // https://atcoder.jp/contests/abc142/tasks/abc142_c
2
+
3
+ use itertools:: Itertools as _;
4
+ use superslice:: Ext2 as _;
5
+
6
+ use std:: io:: { self , Read } ;
7
+
8
+ fn main ( ) {
9
+ let mut input = read_to_static ( io:: stdin ( ) ) . split_whitespace ( ) ;
10
+ macro_rules! read {
11
+ ( [ $tt: tt] ) => ( read!( [ $tt; read!( usize ) ] ) ) ;
12
+ ( [ $tt: tt; $n: expr] ) => ( ( 0 ..$n) . map( |_| read!( $tt) ) . collect:: <Vec <_>>( ) ) ;
13
+ ( ( $( $tt: tt) ,+) ) => ( ( $( read!( $tt) ) ,* ) ) ;
14
+ ( $ty: ty) => ( input. next( ) . unwrap( ) . parse:: <$ty>( ) . unwrap( ) ) ;
15
+ ( { Isize1 } ) => {
16
+ read!( isize ) - 1
17
+ } ;
18
+ }
19
+
20
+ let mut a = read ! ( [ { Isize1 } ] ) ;
21
+ a. invert_permutation ( ) ;
22
+ println ! ( "{}" , a. iter( ) . map( |a| a + 1 ) . format( " " ) ) ;
23
+ }
24
+
25
+ fn read_to_static ( mut source : impl Read ) -> & ' static str {
26
+ let mut input = "" . to_owned ( ) ;
27
+ source. read_to_string ( & mut input) . unwrap ( ) ;
28
+ Box :: leak ( input. into_boxed_str ( ) )
29
+ }
Original file line number Diff line number Diff line change @@ -105,6 +105,12 @@ url = "https://atcoder.jp/contests/abc141/tasks/abc141_c"
105
105
matching = " Words"
106
106
meta = { using = [" proconio" ] }
107
107
108
+ [examples .abc142-c ]
109
+ name = " ABC142: C - Go to School"
110
+ url = " https://atcoder.jp/contests/abc142/tasks/abc142_c"
111
+ matching = " Words"
112
+ meta = { using = [" itertools" , " superslice" ] }
113
+
108
114
[examples .abc142-d ]
109
115
name = " ABC142: D - Disjoint Set of Common Divisors"
110
116
url = " https://atcoder.jp/contests/abc142/tasks/abc142_d"
You can’t perform that action at this time.
0 commit comments