随笔分类 -  OJ-codeforces

摘要:【链接】: "CF985A" 【题意】:给你n和n/2个数ai,每个ai和奇数、偶数比较距离(注意选了奇数,偶数的距离就不要算了,反之同理),求最小的答案。 【代码】: include include include include using namespace std; define N 100 阅读全文
posted @ 2018-05-31 18:08 Roni_i 阅读(222) 评论(0) 推荐(0)
摘要:【题意】: 【分析】:我们要另辟蹊径,从k种不同类型的商品为起点进行BFS,然后求k个点到不同城镇的最短路径,为什么呢?因为k最多100种,如果从城镇为起点BFS,那么1e5的决策次数是会T的。 【代码】: include include include include using namespac 阅读全文
posted @ 2018-05-31 17:49 Roni_i 阅读(299) 评论(0) 推荐(0)
摘要:Jzzhu has invented a kind of sequences, they meet the following property: You are given x and y, please calculate fn modulo 1000000007 (109 + 7). Inpu 阅读全文
posted @ 2018-05-23 21:37 Roni_i 阅读(239) 评论(0) 推荐(0)
摘要:A. Diagonal Walking time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. Diagonal Walking t 阅读全文
posted @ 2018-04-18 19:57 Roni_i 阅读(146) 评论(0) 推荐(0)
摘要:B. Powers of Two B. Powers of Two You are given n integers a1, a2, ..., an. Find the number of pairs of indexes i, j (i < j) that ai + aj is a power o 阅读全文
posted @ 2018-04-18 18:17 Roni_i 阅读(316) 评论(0) 推荐(0)
摘要:D. Black Hills golden jewels time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output time limit 阅读全文
posted @ 2018-04-18 17:14 Roni_i 阅读(364) 评论(0) 推荐(0)
摘要:https://zh.wikipedia.org/wiki/%E8%BC%BE%E8%BD%89%E7%9B%B8%E9%99%A4%E6%B3%95 取模也是一样的,就当多减几次. 在欧几里得最初的描述中,商和余数是通过连续的减法来计算的,即从rk−2中不断减去rk−1直到小于rk−1。一个更高效 阅读全文
posted @ 2018-03-08 18:59 Roni_i 阅读(180) 评论(0) 推荐(0)
摘要:http://codeforces.com/problemset/problem/158/B B. Taxi time limit per test 3 seconds memory limit per test 256 megabytes input standard input output s 阅读全文
posted @ 2018-03-02 18:47 Roni_i 阅读(372) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2018-03-02 00:10 Roni_i 阅读(3) 评论(0) 推荐(0)
摘要:B. Vile Grasshoppers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The weather is fine 阅读全文
posted @ 2018-03-02 00:00 Roni_i 阅读(215) 评论(0) 推荐(0)
摘要:A. Olympiad time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The recent All-Berland Olympi 阅读全文
posted @ 2018-03-01 23:39 Roni_i 阅读(179) 评论(0) 推荐(0)
摘要:B. Our Tanya is Crying Out Loud time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Right now 阅读全文
posted @ 2018-02-25 21:50 Roni_i 阅读(337) 评论(0) 推荐(0)
摘要:A. Points on the line time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We've got no test c 阅读全文
posted @ 2018-02-25 21:45 Roni_i 阅读(295) 评论(0) 推荐(0)
摘要:B. Hamster Farm time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Dima has a hamsters farm 阅读全文
posted @ 2018-02-24 20:32 Roni_i 阅读(356) 评论(0) 推荐(0)
摘要:A. Love Triangle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As you could know there 阅读全文
posted @ 2018-02-24 20:23 Roni_i 阅读(289) 评论(0) 推荐(0)
摘要:【题意】: 鲍勃编程一个机器人在2d迷宫中导航。迷宫有一些障碍。空单元格用'。'表示,其中障碍物用'#'表示。迷宫中有一个机器人。它的起始位置用字符“S”表示。这个位置没有任何障碍。迷宫中也有一个出口。它的位置用字符“E”表示。这个位置没有任何障碍。机器人只能向上,向左,向右或向下移动。当鲍勃编程机 阅读全文
posted @ 2017-12-30 11:47 Roni_i 阅读(180) 评论(0) 推荐(0)
摘要:B. Two Cakes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Two Cakes time limit per 阅读全文
posted @ 2017-12-29 12:54 Roni_i 阅读(636) 评论(0) 推荐(0)
摘要:【题目链接】: Educational Codeforces Round 35 (Rated for Div. 2) A. Nearest Minimums time limit per test 2 seconds memory limit per test 256 megabytes input 阅读全文
posted @ 2017-12-29 11:51 Roni_i 阅读(423) 评论(0) 推荐(0)
摘要:A. Generate Login time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The preferred way to g 阅读全文
posted @ 2017-12-29 10:45 Roni_i 阅读(412) 评论(0) 推荐(0)
摘要:B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Inventory time limit per 阅读全文
posted @ 2017-12-28 18:40 Roni_i 阅读(143) 评论(0) 推荐(0)