B. Psychos in a Line Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/319/B Description There are n psychos standing in a line. Each psycho is assigned a unique integer from 1 to n. At each step every psycho who h…
C - Kalila and Dimna in the Logging Industry 很容易能得到状态转移方程 dp[ i ] = min( dp[ j ] + b[ j ] * a[ i ] ), 然后斜率优化一下. 一直以为炸精度了, 忽然发现手贱把while 写成了if .... #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #d…
D. Psychos in a Line time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n psychos standing in a line. Each psycho is assigned a unique integer from 1 to n. At each step every psycho…
A. Magic Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of…
A. Magic Numbers 不能出现连续的3个4,以及1.4以外的数字. B. Ping-Pong (Easy Version) 暴力. C. Malek Dance Club 考虑\(x\)二进制每一位1,假设位置为\(p\),则前\(p-1\)位都需要一样,否则之前就计算了贡献,那么后面的位可以任取. D. Psychos in a Line 链表模拟. E. Kalila and Dimna in the Logging Industry 因为\(b_n=0\),所以用最小代价砍倒第…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/output 1 s, 256 MB x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB x1462 C Vasya and String standard input/output 1 s, 256 MB x1393…