2022-01-01ãã1å¹´éã®è¨äºä¸è¦§
https://atcoder.jp/contests/abc271/tasks/abc271_dã«ã¼ãã®çµã¨åã§DPããã°ããã§ãããã®æã1æ©åã®åãè¨é²ãã¦ããã¨DPãçµãã£ãå¾ã«trace backã§ãã¦æååãä½ããã¨ãã§ãã¾ãã å¾ããã追å ãã¦ããã®ã§ããã¨ããéé ã®æååã«ãã¾ãã // Flâ¦
https://atcoder.jp/contests/abc282/tasks/abc282_dé£çµæåã«åãã¦ãé£ãåããã¼ããç½ã¨é»ã«å¡ãåãã¾ããå¡ãåããããªãã£ããäºé¨ã°ã©ãã§ã¯ããã¾ãããããã¦ãé£çµæåã®ä¸ã¨é£çµæåã®éã«ã¨ãã¸ãããã¤ä½ããããæ°ãã¾ãã // Make Bipartiâ¦
https://atcoder.jp/contests/abc276/tasks/abc276_dAã®gcdã«Aã®åè¦ç´ ãä½åå²ã£ã¦ãã©ãçãããã«ã¦ã³ããã¾ãã reduceã£ã¦ç¡ããã§ãããfoldã ã¨gcdã¯ã¡ãã£ã¨é¢åã§ãããã // Divide by 2 or 3 #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut</t:>â¦
https://atcoder.jp/contests/abc277/tasks/abc277_dAãã½ã¼ããã¦ãã°ã«ã¼ãåãã¾ãããã¨ã¯æåã¨æå¾ããã£ã¤ããã§ããã // Takahashi's Solitaire #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_</t:>â¦
https://atcoder.jp/contests/abc281/tasks/abc281_dãã¼ãåæ°ã¨åã®Dã®å°ä½ãå¤ãåã®æ大å¤ã¨ããDPã§ããã // All Assign Point Add #![allow(non_snake_case)] use std::collections::HashMap; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::i</t:>â¦
https://atcoder.jp/contests/abc278/tasks/abc278_dHashMapã使ãã°ç°¡åã§ããã // All Assign Point Add #![allow(non_snake_case)] use std::collections::HashMap; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut li</t:>â¦
https://atcoder.jp/contests/abc279/tasks/abc279_då¾®åã使ããªãã¦ãã3ç¹ã®åºéãåã ã«ãã¦ãã£ã¦ã3ç¹ã®ä¸ã§çãä¸ãä¸çªæéãçããã°ãããããçãä¸ãä¸çªæéãçãç¶æ ããã¼ããã¤ã¤åºéã縮å°ãã¦ããã¾ãã // Freefall #![allow(non_snake_â¦
https://atcoder.jp/contests/abc279/tasks/abc279_då¾®åãã¦0ã«ãªãç¹ãããåå¾ã調ã¹ã¾ãããã ãã1ããå°ãããªã£ã¦ã¯ããã¾ããã // Freefall #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line</t:>â¦
https://atcoder.jp/contests/abc280/tasks/abc280_dç´ å æ°å解ããã°ããã¨ã¯ç´ æ°ãã¨ã«è¨ç®ããã°ããã§ããã ç´ æ°ãã¨ã«æ¡ä»¶ãæºããæå°ã®åæ°ãæ±ããé¨åã¯ãã£ã¨å¹çã®ããæ¹æ³ãããã¨æãã¾ãããç´ å æ°å解ã«æ¯ã¹ãã°ååã«éãã§ããã // Factoâ¦
https://atcoder.jp/contests/abc272/tasks/abc272_dç´ å æ°å解ããã§ããã°ã移åã§ããã¹ããããé«éã«æ±ãããã¾ãããã®ããã«ãGaussIntã¨ããæ§é ä½ãä½ãã¾ããã ãããã°ã®ããã«fmtã¨ããã¡ã½ãããä½ã£ã¦è¤ç´ æ°ãåºåã§ããããã«ãã¾ãããããâ¦
https://atcoder.jp/contests/abc272/tasks/abc272_dã©ãã¸é²ãããã¯ãã¤ã¼ãã«å®è£ ãã¦ãååã«éã«åãã¾ããã ä½æ©ã§è¡ãããã¯Queueã使ãã°ããã§ãããRustã§ã¯VecDequeã¨ããcollectionã使ãããã§ãã // Root M Leaper #![allow(non_snake_case)â¦
https://atcoder.jp/contests/abc273/tasks/abc273_dãããè¡ã¨åã§åãã¦èãããã¨ãã§ãã¾ãã å£ã®åº§æ¨ãåè¡ãååã§æ ¼ç´ãã¾ãã ãã®éã«äºåæ¢ç´¢ãããã®ã§ã½ã¼ããã¾ãããHashMapã®ä¸ã®Vecãã©ãã½ã¼ããã¦ããã®ãåãããªãã£ãã®ã§ãæ°ãã«Hashâ¦
https://atcoder.jp/contests/abc274/tasks/abc274_dx軸ã¨y軸ã§åãã¦èããã°ããã§ãã ãã¨ãflattenãã¡ããã¨ãããã§ããã // Robot Arms 2 #![allow(non_snake_case)] use std::collections::HashSet; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(</t:>â¦
https://atcoder.jp/contests/abc275/tasks/abc275_dmemoizeã¨ããcrateã使ãã°ç°¡åã§ãã ãã ãAtCoderã§ã¯ä½¿ããªãããã§ãã // Yet Another Recursive Function #![allow(non_snake_case)] use memoize::memoize; fn read<T: std::str::FromStr>() -> T { let mut line = Str</t:>â¦
https://atcoder.jp/contests/abc275/tasks/abc275_dæ§é ä½ã«ã¡ã¢ãç½®ãã°ãããªã«æ°æã¡æªããªãã¨æãã¾ãã // Yet Another Recursive Function #![allow(non_snake_case)] use std::collections::HashMap; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(</t:>â¦
https://atcoder.jp/contests/abc275/tasks/abc275_dABCã®Dåé¡ã解ãã¦ããã¾ãã åãªãã¡ã¢åã®åé¡ã§ãããRustã§ã¯ã°ãã¼ãã«å¤æ°ãé£ããã®ã§ãã¿ã£ã¨ããªãã§ããé¢æ°ã«ã¡ã¢ã渡ãã¾ãã // Yet Another Recursive Function #![allow(non_snake_case)â¦
https://atcoder.jp/contests/abc270/tasks/abc270_cåç¹ã®Xããã®è·é¢ã調ã¹ã¦ãYãããã¬ã¼ã¹ããã¯ãã¾ãã Yã«ãã©ãçãããè·é¢ã調ã¹ãã®ãæã¡åã£ã¦ãããã®ã§ãããããã§ãååéãã§ãã // Simple path #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -></t:>â¦
https://atcoder.jp/contests/abc271/tasks/abc271_cBTreeSetã使ã£ã¦ãä¸ã¤ãã¤treeã«insertãã¦ãéè¤åã¯åå大ããªå¤ã«ãã¦insertãã¾ãã æåã¯Vecã使ã£ã¦å®è£ ãã¾ãããããã¡ãã®æ¹ãéãã£ãããã§ãã // Manga #![allow(non_snake_case)] use stâ¦
https://atcoder.jp/contests/abc272/tasks/abc272_cAãå¶æ°ã¨å¥æ°ã«åããã°ããã§ãããfilterã使ã£ã¦ç°¡åã«æ¸ãã¨ã©ããã¦ãVecã«ãªã£ã¦ãã¾ãã¾ãã let mut evens = Vec::<i32>::new(); let mut odds = Vec::<i32>::new(); for a in A.iter() { if a % 2 == 0 { </i32></i32>â¦
https://atcoder.jp/contests/abc273/tasks/abc273_cgroupbyã使ããã°ç°¡åã§ãããitertools::Itertoolsã«group_byã¨ããã®ãããã¾ããã ãã¨ãfã«Vecãmutableã§æ¸¡ãã¨ããã©ããªã®ã§ã渡ãåã«sortãã¾ãã // (K+1)-th Largest Number #![allow(non_snâ¦
https://atcoder.jp/contests/abc274/tasks/abc274_cãã ã®DPã§ããã // Ameba #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok(); line.trim().parse().ok().unwrap() } fn read_vec<T: std::str::FromStr></t:></t:>â¦
https://atcoder.jp/contests/abc255/tasks/abc255_cçå·®æ°åãæ§é ä½ã«ããã°æ¥½ã«ãªãã¾ãããè² æ°ã絡ãã¨ä¸å®ã«ãªãã¾ããã // ±1 Operation 1 #![allow(non_snake_case)] use std::cmp::min; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::</t:>â¦
https://atcoder.jp/contests/abc256/tasks/abc256_cããããã¨æããã¾ãã if hs.iter().sum() != ws.iter().sum() { 40 | if hs.iter().sum() != ws.iter().sum() { | ^^^ cannot infer type for type parameter `S` declared on the associated functionâ¦
https://atcoder.jp/contests/abc257/tasks/abc257_cåä½éã«å¯¾ãã¦åã©ããä½äººã大人ãä½äººããããMapã«å ¥ãã¾ãããã½ã¼ããã¦ä½¿ãããã®ã§BTreeMapã使ãã¾ãã // Robot Takahashi #![allow(non_snake_case)] use std::collections::BTreeMap; fn read<T: std::str::FromStr></t:>â¦
https://atcoder.jp/contests/abc258/tasks/abc258_c1ã®å¦çããã代ããã«å é ã®ä½ç½®ãå¤ãã¾ãã // Rotation #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok(); line.trim().parse</t:>â¦
https://atcoder.jp/contests/abc260/tasks/abc259_cgroupbyã使ãã°ç°¡åã§ããPartialEqã¨Copyãå®è£ ããã¦ããã°OKã®ããã§ãã // XX to XXX #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut</t:>â¦
https://atcoder.jp/contests/abc260/tasks/abc260_cçµå±ãHashMapã¯entryã使ããªãã¨ãã¾ããããªãã§ããã // Changing Jewels #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok();</t:>â¦
https://atcoder.jp/contests/abc261/tasks/abc261_cçµå±ãHashMapã¯entryã使ããªãã¨ãã¾ããããªãã§ããã // NewFolder(1) #![allow(non_snake_case)] use std::collections::HashMap; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin(</t:>â¦
https://atcoder.jp/contests/abc262/tasks/abc262_cã¤ã³ããã¯ã¹ã¨åããã®ã¨å¾å¾©ããã¨åãã«ãªããã®ãæ°ãã¾ãã // Min Max Pair #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok</t:>â¦
https://atcoder.jp/contests/abc263/tasks/abc263_ccombinationsã使ãã ãã§ããã // Monotonically Increasing #![allow(non_snake_case)] use itertools::Itertools; fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut </t:>â¦