File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ // https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_c 
2+ 
3+ use  defmac:: defmac; 
4+ use  fixedbitset:: FixedBitSet ; 
5+ 
6+ use  std:: io:: { self ,  Read  as  _} ; 
7+ 
8+ fn  main ( )  { 
9+     let  mut  input = "" . to_owned ( ) ; 
10+     io:: stdin ( ) . read_to_string ( & mut  input) . unwrap ( ) ; 
11+     let  mut  input = input. split_whitespace ( ) ; 
12+     defmac ! ( read => input. next( ) . unwrap( ) . parse( ) . unwrap( ) ) ; 
13+ 
14+     let  x:  usize  = read ! ( ) ; 
15+ 
16+     let  mut  dp = FixedBitSet :: with_capacity ( x + 105 ) ; 
17+     dp. insert ( 0 ) ; 
18+     for  i in  0 ..=x. saturating_sub ( 100 )  { 
19+         if  dp[ i]  { 
20+             // `insert_range` does not accept `RangeInclusive<usize>`. 
21+             dp. insert_range ( i + 100 ..i + 106 ) ; 
22+         } 
23+     } 
24+     println ! ( "{}" ,  u32 :: from( dp[ x] ) ) ; 
25+ } 
Original file line number Diff line number Diff line change @@ -83,3 +83,8 @@ matching = "Words"
8383name  = " ATC002: B - n^p mod m" 
8484url  = " https://atcoder.jp/contests/atc002/tasks/atc002_b" 
8585matching  = " Words" 
86+ 
87+ [examples .sumitrust2019-c ]
88+ name  = " Sumitomo Mitsui Trust Bank Programming Contest 2019: C - 100 to 105" 
89+ url  = " https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_c" 
90+ matching  = " Words" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments