题意:给定 n 个地方,然后再给 m 个任务,每个任务必须在规定的地方完成,并且必须按顺序完成,问你最少时间. 析:没什么可说的,就是模拟,记录当前的位置,然后去找和下一个位置相差多长时间,然后更新当前位置即可. 代码如下: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; typedef long long LL; int main(){ int n, m, x; while(cin >>…
题目链接: B. Modulo Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a sequence of numbers a1, a2, ..., an, and a number m. Check if it is possible to choose a non-empty subse…
Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86821#problem/G Description You are working in Advanced Computer Monitors (ACM), Inc. The company is building and selling giant c…
题目链接: A. Round House time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entra…
B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are al…
题目链接: A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array consisting of n integers. Your task is to find the maximum length of an increasing subarray of…
C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C Description Cinderella is given a task by her Stepmother before she is allowed to go to the Ball. There are N (1 ≤ N ≤ 1000) bottles with water in th…
题目链接:http://codeforces.com/problemset/problem/339/B 题目理解不难,这句是解题的关键 In order to complete the i-th task, she needs to be in the house number ai and complete all tasks with numbers less than i .从样例1的提示,可以知道,如果a[i] > a[i+1],则需要继续顺时针走下去,直到到达n,接着重新从1开始数,直…
B. Island Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description On February 30th this year astronauts from the International Space Station flew over the Pacific Ocean and took a picture, on which was discovered a pr…
题目链接:https://codeforces.com/contest/1090/problem/A A conglomerate consists of n companies. To make managing easier, their owners have decided to merge all companies into one. By law, it is only possible to merge two companies, so the owners plan to s…
B. s-palindrome 题目连接: http://www.codeforces.com/contest/691/problem/B Description Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the…
题目链接: A. Pouring Rain time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A lot of people in Berland hates rain, but you do not. Rain pacifies, puts your thoughts in order. By these years you h…
题目链接: http://codeforces.com/contest/659/problem/A 题意: 一个圈,按逆时针编号,给定起点,方向和步数,问终点在几号? 分析: 很简单的模拟...注意答案为0的时候应该输出n... 代码: #include<iostream> using namespace std; int main (void) { int n, a, b;cin>>n>>a>>b; b = (b - 1) %n + 1; int k =…
题目链接: A. Infinite Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya likes everything infinite. Now he is studying the properties of a sequence s, such that its first element is…
A. Save Luke time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Luke Skywalker got locked up in a rubbish shredder between two presses. R2D2 is already working on his rescue, but Luke needs to…
A. Ebony and Ivory time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Dante is engaged in a fight with "The Savior". Before he can fight it with his sword, he needs to break its shields.…
B. The Time time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given the current time in 24-hour format hh:mm. Find and print the time after a minutes. Note that you should find only t…