随笔分类 -  技巧 模拟

摘要:链接: http://codeforces.com/contest/819/problem/B 题意: 有n个数,从1到n乱序排列,定义这n个数的秩序值为∑(a[i]-i) (1<=i<=n), 你每次将这个数组向右循环移位p次, 问p等于多少时,这n个数的秩序值最小? 题解: 记录下每个数是在目标 阅读全文
posted @ 2017-08-15 11:48 Flowersea 阅读(154) 评论(0) 推荐(0)
摘要:31 class Solution { 32 public: 33 string intToRoman(int num) { 34 char* c[4][10] = { 35 { "","I","II","III","IV","V","VI","VII","VIII","IX" }, 36 { "","X","XX","XX.. 阅读全文
posted @ 2017-04-24 13:46 Flowersea 阅读(536) 评论(0) 推荐(0)
摘要:连接: http://codeforces.com/contest/797/problem/E 题意: 给你一个a数组,q次询问,每次给你个p,k 每次操作使p=p+a[p]+k,直到p大于n为止 问一共操作了多少次 题解: 先预处理k不超过325时候的答案,当k大于325的时候就暴力算 代码: 阅读全文
posted @ 2017-04-20 17:31 Flowersea 阅读(161) 评论(0) 推荐(0)
摘要:C. New Year and Rating 链接: http://codeforces.com/contest/750/problem/C 代码: 阅读全文
posted @ 2017-02-23 14:05 Flowersea 阅读(196) 评论(0) 推荐(0)
摘要:D. Artsem and Saunders 链接: http://codeforces.com/contest/765/problem/D 代码: 阅读全文
posted @ 2017-02-15 09:37 Flowersea 阅读(258) 评论(0) 推荐(0)
摘要:C. Sanatorium 链接: http://codeforces.com/contest/732/problem/C 代码: 阅读全文
posted @ 2016-10-18 18:14 Flowersea 阅读(232) 评论(0) 推荐(0)
摘要:F. Restore a Number 链接: http://codeforces.com/contest/670/problem/F 题意: 给你一个数字字符串,再加上长度,然后打乱 再给你一个原字符串的子串,求出最小的原字符串 题解: 其实字符串的长度是确定的,只会有一个解,先算出字符串长度,枚 阅读全文
posted @ 2016-10-12 02:02 Flowersea 阅读(349) 评论(0) 推荐(0)