0w1

Entries from 2016-08-07 to 1 day

CFR 701 D. As Fast As Possible ( Math + Binary Search )

Problem - D - Codeforces 本番中 "reversal of the bus, take place immediately and this time can be neglected" を「バスの移動は時間がかからない」と勘違いし、とけなかった。。反転だけの時間という事。Let's think about binary searching minimum t…

CFR Educational 15 E. Analysis of Pathes in Functional Graph ( Doubling )

Problem - E - Codeforces Basic doubling technique, nothing quite special. void solve(){ int N; ll K; cin >> N >> K; vi F( N ), W( N ); for( int i = 0; i < N; ++i ) cin >> F[ i ]; for( int i = 0; i < N; ++i ) cin >> W[ i ]; const int LOGN =…

CFR Educational 15 D. Road to Post Office ( Ad hoc )

Problem - D - Codeforces The key is to realize that there are only 3 possible optimal strategies. 1. Drive the car once, and walk for the rest. 2. Keep going with the car no matter what. 3. Drive until the remained distance is not worth to…

CFR 703 E. Mishka and Divisors ( Math + DP )

Problem - E - Codeforces It was quite disgusting, for many optimisations were required. I read pekempey's article and I think it is easy to understand. pekempey.hatenablog.com The small / large id reference especially made me learn somethi…

CFR 703 D. Mishka and Interesting sum ( XOR, BIT )

Problem - D - Codeforces This is actually a good problem. While as always xor-sum will give us only the xor-sum of the values that appeared odd number of times in the range, we have to find the xor-sum of each number that appeared even num…