2012-09-01ãã1ã¶æéã®è¨äºä¸è¦§
3671 -- Dining Cows [åé¡] 1ã¾ãã¯2ãã©ã³ãã ã«Nå並ãã§ãããä»»æã®ç®æã1 -> 2 ããã㯠2 -> 1ã¨æ¸ãæãããã¨ã§ãå ¨ã¦ã®1ã2ããåã«æ¥ãããã«ãããã æ¸ãæããåæ°ã®æå°å¤ãæ±ããã [解æ³]1ã°ã«ã¼ãã¨2ã°ã«ã¼ããã©ãã§åãããã§å ¨æ¢ç´¢ãâ¦
2186 -- Popular Cows [åé¡] Måã®ãã¢(A,B): çAãçBã人æ°è ã ã¨æã£ã¦ãã ãä¸ããããããã ã (A,B) ,(B,C) => (A,C) ã¨ããã(é¢ä¿ã¯æ¨ç§»ç) èªå以å¤ã®å ¨ã¦ã®çãã人æ°è ã ã¨æããã¦ããçã®æ°ãæ±ãã ãã£ã¨æ¾ç½®ãã¦ããè»æ¬ã®åé¡ã ãã¹ã¦ã®â¦
åé¡æâ 2140 -- Herd Sums[åé¡] èªç¶æ°Nãä¸ããããã Nãé£ç¶ããèªç¶æ°ã®åã§è¡¨ãã¨ä½éãã§ãããã(ä¾) N = 15 [7+8 , 4+5+6 , 1+2+3+4+5 , 15] 4éã Sum(b) - Sum(a-1) = Sum([a,b]) ã¿ãããªãã¨ãã㨠O(n^2)ã¨ãã«ãªã£ã¦éã«åããªãããªã®ã§ S(â¦
åé¡æâAIZU ONLINE JUDGE 10é²æ°ã-10é²æ°ã«ç´ãåé¡ã x mod (-10)^nããã£ã¦ãã (è² ã«ãªã£ãæã¯æ£ã«ãã¦ãã) string Trans(int n){ string ans=""; while(n != 0){ int mod=n%(-10); int nxt=n/(-10); if(mod < 0){ mod+=10; nxt++; } char c='0'+mod;â¦