2019-01-01ãã1å¹´éã®è¨äºä¸è¦§
ããããï¼ åé¡ã¸ã®ãªã³ã¯ï¼ ååã®è§£èª¬ã¯ ãã¡ãã®ããã° ã«è©³ããã§ãï¼ A â 2 åãã§ã㯠/ Is It a Number? #include <cctype> ããã㨠isdigit(c) ã¨ããã®ã使ãã¦ï¼c ãæ°åãã©ãããå¤å®ã§ãã¾ãï¼ è¿ãå¤ã¯ 0 ã 0 以å¤ãªã®ã§ï¼ä»¥ä¸ã®ãããªã³ã¼ãã§ã¯ã</cctype>â¦
ããã®ã話ãæ¸ãã¦ã¿ã¾ãï¼ codeforces.com åé¡æ¦è¦ ç´ æ° \(m\) ã¨ï¼è¦ç´ æ° \(n\) ã®æ°ã®éå \(A\) ãä¸ããããï¼ æ¬¡ã®æ¡ä»¶ãæºãã \(x\) ããã³ \(d\) ãåå¨ããã°ãããåºåããï¼ ããã®éåã並ã¹æ¿ãã¦ã§ããé·ã \(n\) ã®æ°åã®ãã¡ï¼\(i\) é ãâ¦
å®åæ ãã®è¨äºã¯ Competitive Programming (1) Advent Calendar 2019 ã® 17 æ¥ç®ã®è¨äºã§ãï¼ adventar.org ã¾ããã ãã¼ï¼æªå®ç¾©åä½ã¨ããè¨èãç¥ã£ã¦ãã¾ããï¼ å¿ è¦ã«å¿ã㦠æã®è¨äº ãèªãã¨ããããããã¾ããï¼ C++ ãæ¸ãä¸ã§ãããç°å¢ä¾åãâ¦
åå è¨ãæ¸ãã¦ããã¾ãï¼ icpc.iisf.or.jp ããã«åå ãã¦ãã¾ããï¼ äºé¸ã®ã¨ãã®è¨äº Day 0 åæ³ãããªãã¨ç ´æ» ãã確çãã°ãã¨é«ã¾ãã®ã§ï¼ã¾ã移åããã¾ãï¼ ç©ºæ¸¯ã§éã³ã¾ãï¼ ãã®è±åãã©ã³ãããªã«ãªã®ãæ°ã«ãªã£ã¦ãã¾ã pic.twitter.com/4lbLcILâ¦
ãã¶ãä»æ¥ã使ããªãã¨æããã§ããã©ï¼åæ¨çï¼ï¼ ã¿ã¤ãã«ã®å ãã¿ã¯ ããï¼ ä¸ã®ã¹ã©ã¤ãã§ã¯ï¼ã¯ã¼ããµã¤ãº \(w\) ã«å¯¾ãã¦ï¼ä»¥ä¸ã®æ¼ç®ã \(O(\log w)\) time ã§æ±ããæ¹æ³ãæ¸ããã¦ãã¾ãï¼ ç«ã£ã¦ããæä¸ä½ã®ããããåãåºãï¼msb ç«ã£ã¦ããããâ¦
Fibonacci ãã¼ãã使ãã¨åªå 度ããªããå®æ°æéã§å¤æ´ãããã¨ãå¯è½ã§ããã¼ï¼ã¨ãã話ã æ¸ãã¾ããï¼ ã©ãããï¼Java ã ã¨ï¼ããããã®ããããããããã§ãï¼ ãããã£ã¡ãå¬ãããã¼ã¿æ§é ã Java使ã£ã¦ãã¨ãnew Edge(int dest, int distance);ã®ã³ã¹â¦
åèã«ããã®ã¯ï¼ãã¤ãã® CS166 ã®ã¹ã©ã¤ãï¼ ãã§ããæä½ãããã®æä½ã§ã§ãããããããã¨ããå®è£ ãã®é ã«æ¸ãã¾ãï¼äºå®ï¼ï¼ è±èªã楽ã«èªãã人ã¯ä¸ã®ã¹ã©ã¤ããè¦ãã¨ããããã§ãï¼ ã§ããæä½ ã¾ãï¼ããã¯ãã¼ããªã®ã§ï¼åªå 度ã¤ããã¥ã¼ã®åºæ¬ä¸â¦
ãã¼ã ç·´ããã¾ããï¼ä¹ ã ã§ããï¼ onlinejudge.u-aizu.ac.jp B ã¯ç¥ã£ã¦ãã¾ãï¼é ãã¤ãã¦ããªãããããæ¸ãã¾ãã... A ãã¤ãããã«ä»»ãã¦ããéï¼ç´ã§ã¡ããã¨è©°ãã¦ï¼B ã ACï¼ C ã¯è¦ããã¨ããï¼ã¤ããããä¸çºã§ãµã³ãã«ãåããã¦ãã¦å¤©æï¼ACï¼â¦
JAG å¤å宿 2019 ã«ç¶ãã¦ï¼ACPC 2019 ã«åå ãã¾ããï¼ ããããå¿ããã¦å¾åãã«ãã¦ããã®ã§è¨æ¶ãããã ãã§ãï¼ atnd.org Day -1 = JAG å¤å宿 2019 Day 3 ããã«ã«çãã¾ããï¼ä¸æ¥çµäºã§ãï¼ Day 0 ç²ãã¦ããã®ã§ã»ã¨ãã©ããã«ã«ãã¾ããï¼ ä½åã®â¦
JAG ã®å¤å宿ã«åå ãã¦ãã¾ããï¼ ããããå¿ããã¦åå è¨ãæ¸ãã®ãå¾åãã«ãã¦ãã¾ã£ã¦ãã¾ããï¼ jag-icpc.org Day 0 å¤æ¹ã®é£è¡æ©ã§æ±äº¬ã«åãããã§ããï¼ãæ¼åãããã«ç©ºæ¸¯ã«è¡ã£ã¦éãã§ãã¾ããï¼ ãã¿ã£ã³ãããã®ãã¼ã«ãã³ãè²·ã£ãããã¾ããâ¦
è¦å¯ã ï¼ï¼ã¤ã³ã¿ã¼ããã memeï¼ ä»¥ä¸ã®æ£è¦è¡¨ç¾ã§è¡¨ãããèå¥åã¯æã ã¯åæã«ä½¿ã£ã¦ã¯ããã¾ããï¼ å¦çç³»ã«äºç´ããã¦ãã¾ãï¼ã³ã³ãã¤ã©ã®å é¨å©ç¨ãæ¨æºã®ãããï¼<algorithm> ã¨ãï¼ã§ä½¿ãããã®ãã®ã§ãï¼ .*__.* _[A-Z].* _.*ï¼ã°ãã¼ãã«åå空éã®ã¿ï¼ æ£è¦</algorithm>â¦
人ã ããã¯ãããã¡ã使ã£ã¦ããã§ããï¼ç½ ãç解ãã¦ã人ãå¤ãã¨ã¯æããªãã®ã§ããã¤ãæ¸ãã¾ãï¼ å®æ°å®ç¾© constexpr 使ã£ã¦ãããï¼ #define INFLL 1e18 int main() { ... if (x == INFLL) return puts("-1"), 0; } ã®ãããªã³ã¼ãã¯ç«¶ããã§ãããã¡ã§â¦
人ã ã¯æªå®ç¾©åä½ã«å¤ããæå¾ ããã¡ã§ã¯ã¨ããæ°æã¡ãããã®ã§æ¸ãã¾ãï¼ ã¾ããããããã¯æªå®ç¾©åä½ã§ããã¨è¨ã£ãã¨ãï¼ç®ã«è¦ãããã°ããã¨*1ãçºçããã¨ã¯éããªãã§ãï¼ããªãããã¾ããããã¨ããå¿ ãå®è¡æã¨ã©ã¼ã«ãªããã¨ãã¯ä¿è¨¼ããã¦ãã¾ãâ¦
ã©ãããç½ ãããã®ã§æ¸ãã¾ãï¼ å·éã«èããã¨ãåå¿è ã®äººã¯ãªã㧠set ã¯è¦ç´ ã®æç¡ã®å¤å®ãé«éãªã®ããã©ã®ãããé«éãããªã©ã¯ããã£ã¦ãªãã¯ãã§ããããªãã¨ãstd::lower_bound ã§æ±ãããã¨ããã¨ã©ããã¦ã ããªã®ããããããªãã¦å½ç¶ã¨ããæ°ãâ¦
std::multiset ã®ç½ ã£ã½ãä»æ§ã¨ï¼ãã®ä»æ§ãªã®ã妥å½ã ã¨æããããªèª¬æããããã¤ããã¾ãï¼ æ°ãåã次第ï¼å¥ã®ç½ ãåå¿è åã tips ãä»å¾æ±ãã¨æãã¾ãï¼ ç½ ä»¥ä¸ã®äºã¤ã«ã¤ãã¦æ£ããçãããã¾ããï¼ erase std::multiset<int> ms; ms.insert(0); ms.inse</int>â¦
æ¯é¢æ°ã®ãåå¼·ãããããããã®ã§ï¼ããã£ãæ°ã«ãªã£ããã¨ãèªåç¨ã«ã¾ã¨ãã¾ããï¼ github.com ãã£ã¨ä½ç³»çã«ãåå¼·ããã¹ãã§ã¯ããããï¼ ãã³ã¡ãããä»ãåå¼·ããã¹ãå 容ã¯ããã§ã¯ãªããããªæ°ããããï¼
ï¼æ³¨æï¼ãã¶ããã¿è¨äºã§ãï¼ç´ ç´ã«è¡åç´¯ä¹ãã¦ãã ãã*1ï¼ åçªãªãã§ããï¼ä»¥ä¸ã®å¼ã \(10^9+9\) ãæ³ã¨ãã¦è¨ç®ãã¦ã¿ã¾ãããï¼ (308495997 ** i - 691504013 ** i) * 723398404 Python ã«ã¾ããã¾ãï¼ >>> [(308495997 ** i - 691504013 ** i) * 72â¦
TTPC 2019 ã«åå ãã¦ãã¾ããï¼ atnd.org atcoder.jp Day 0 åæ¥å ¥ããã¦æ©ãã¯ããé£ã¹ãå¾ãããå¯ãã¦ãã¾ãï¼å¤å¯ãããªãã£ãã®ã§ãã©ãµãããã£ã¦ãã¾ããï¼ Day 1 ãDay 1ãã¨ãè¨ã£ã¦ï¼"TTPC" ã¯ä¸æ¥ã ããªãã§ããã©ãï¼ åæ¥ã«ãã©ãµãããã£ã¦ãâ¦
ããã®è§£èª¬ãæ¸ãã¾ãï¼ atcoder.jp åé¡æ¦è¦ ç´ æ° \(p\) ã¨é·ã \(p\) ã®ãã¤ããªå \(a_0, \dots, a_{p-1}\) ãä¸ããããï¼ \(f(x) = \sum_{i=0}^{p-1} b_i\cdot x^i\) ã§ãã£ã¦ï¼\(f(j) = a_j\) ã¨ãªããããªãã®ã®ä¿æ° \(b_i\) ãæ±ãã¦ãï¼ ã¼ãããæâ¦
å®çªãªãã§ããï¼ãããèªã¿ãªããåå¼·ãã¾ããï¼ ï¼Chrome ã ã¨ãµã ãã¤ã«è¡¨ç¤ºãããªãï¼ï¼ https://compro.tsutaj.com/archive/181015_incexc.pdf ææ¥ã®æã¾ã§ã«å é¤åçã®å®å ¨ç解è ã«ãªãã®ã§ãã®ã¤ããã§â ãã³ã¡ãã (@rsk0315_h4x) 2019å¹´8æ9æ¥ ãâ¦
ãã¼ãã¼ï¼ãã³ã¡ãããé»è²ã«ãªã£ãã¼ï¼ pic.twitter.com/qC8oFMx74Câ ãã³ã¡ãã (@rsk0315_h4x) August 4, 2019 ã¤ãã«é»è²ã«ãªãã¾ããï¼ rsk0315.hatenablog.com rsk0315.hatenablog.com ãããã¨åããã¦ã§ãï¼ ãã¨ã ãæ¸ãããã®ã§æ¸ãã¾ãï¼ TL; DRâ¦
ãã¼ãã¼ï¼ãã³ã¡ãããç´«ã«ãªã£ãï¼ pic.twitter.com/GcA1cRnva1â ãã³ã¡ãã (@rsk0315_h4x) July 30, 2019 ãã³ã¡ãããç´«ã«ãªãã¾ããï¼ ã¨ããã§ãè¡èè²ãã¨æ¸ãã¦ããã³ãããã¨èªã¿ã¾ãï¼ ç´«ã«ãªãã¾ã§ãã£ãã㨠è¿ã AtCoder ã§é»è²ã«ãªãäºå®ãªã®â¦
HUPC 2019 ã«åå ãã¾ããï¼ å大ã¯ï¼ACPC ã RUPC ã§ä½åã®æ å½ãããã®ã¯ä»¥åãããã¦ãããã§ããï¼å宿ãéãã®ã¯åãã¦ãªã®ã§ï¼ä¸»ã«ã¤ããããï¼å¤§å¤ã ã£ãã¨æãã¾ãï¼ ã»ã¨ãã©ã®ãã¨ãã¤ãããããã£ã¦ãã¦ï¼ãã³ã¡ããã«ã¯ã¨ã¦ãã¾ãã§ããªããªãã¨â¦
ãã³ã¡ãã㯠four-t ã®ãã¨ãã¨ã£ã¦ãããã ã£ããã ãªãã¨ããã®ãå®æãã¾ããï¼ four-t ã¨ããã®ã¯å大ã®ãã¼ã ã§ï¼ã¤ããã (tsutaj) / ãã¶ãã (TAB) / ãã³ã¡ãã (rsk0315) ã®ä¸äººã§ãï¼ three-t ãªã®ã§ã¯ï¼ ã¨ãèããã¾ããä¸æ¦ç¡è¦ãã¾ãï¼ fourâ¦
ãã¼ã ç·´ããã¾ããï¼ onlinejudge.u-aizu.ac.jp æ£ç´ãã¾ãè¦ãã¦ããªãï¼ A ã¤ãå®æã§ï¼B å¾åãå®æã§ï¼C ããéãå®æã§ï¼B ãªãã¨ããªãå®æï¼ B æ¸ãã¦ããããããçãã¦ã¦ï¼E ã ACï¼ D ã¯ãã³ã¡ããã®ç³ã訳ãªã㧠1 TLE ããããã©ãã ACï¼ F ãâ¦
èªåã®ååãé»è²ã§è¡¨ç¤ºããã¦ãã®ãè¦ã¦ã«ã£ããããã®ãä½åããã£ãï¼ ããã«ãªããã人çã ã£ãï¼ @qnighy SRM ã« 2 ååå ãã¾ããâ æºæ¥ãã (@semiexp) March 15, 2014 ãã¨æ©ã AtCoder 㧠Beginner ãåæ¥ããããã ãã©ï¼ã¾ã ã¾ã 足ãã¦ãªãæ°ããâ¦
ãã¼ã ç·´ããã¾ããï¼ onlinejudge.u-aizu.ac.jp A ã¯ã¤ããããæéåãä¸å®æï¼ ãã¶ããã C ãéãï¼ ã¤ãããã A ãç´ãã¦ãéã«ãã³ã¡ãããç´ã§è©°ãã¦ï¼ã©ã£ã¡ã ACï¼ D 㨠E ãã¤ããããä¸ç¬ã§çµãããã¦ã¦å¤©æãï¼ ã¨ãªãå®æï¼ G æ§æ解æããã¼â¦
ãã¼ã ç·´ããã¾ããï¼ onlinejudge.u-aizu.ac.jp A ã¤ãå®æï¼ B ã¯ãã³ã¡ãããããã£ã¨ã§ããããªã®ã§ããã£ã¨ããï¼ å ¥åå½¢å¼ãã¤ããã£ã½ãæãã ã¨ãã³ã¡ãã以å¤ãã¤ãããã¨ã«ãªã£ã¦ï¼ç¸å¯¾çã«å¾ãããã¡ï¼ C ã¯ãã¶ãããã¡ãã£ã¨ã¤ãããã«ãã¦ãã®â¦
ãã¼ã ç·´ããã¾ããï¼ onlinejudge.u-aizu.ac.jp ææ¥ããã¾ãï¼ pic.twitter.com/uxQPlVHSFLâ 7/14ã»15 HUPC (@homuhomucomp) July 2, 2019 ã°ã¡ã A ã¤ãå®æï¼B ã¯ç°¡åããï¼æ¸ããã¨ãã¦ããã©ï¼C ã®ããã³ã¡ããã½ããããï¼ ãã¶ããã« B ãæããï¼ãâ¦
ãã¼ã ç·´ããã¾ããï¼ragan ã®ã°ã¡ãã«æ··ãã£ãå¾ãªã®ã§ã¤ããã¦ã¾ããï¼ãã㯠ragan ã®äººãã¡ããããªãã ããï¼ï¼ onlinejudge.u-aizu.ac.jp A ã¯ã¤ãããå®æï¼ãã³ã¡ãã㯠B ããã£ã¦ã¦ãã¾ãæãåºããªããã©ï¼ã¡ãã£ã¨æéããã£ã¦ãã½ãï¼ ãã³ã¡ãâ¦