A. Alyona and copybooks time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have eq…
A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed…
Description On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible nu…
题目链接:https://codeforces.com/contest/1090/problem/B Examplesstandard input The most famous characters of Pushkin’s works are Onegin \cite{onegin}, Dubrovsky \cite{dubrovsky} and Tsar Saltan \cite{saltan}. \begin{thebibliography}{99} \bibitem{saltan} A…
B. Mishka and trip time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output Little Mishka is a great traveller and she visited many countries. After thinking about where to travel this time, she cho…
Zane the wizard is going to perform a magic show shuffling the cups. There are n cups, numbered from 1 to n, placed along the x-axis on a table that has m holes on it. More precisely, cup i is on the table at the position x = i. The problematic bone…
Wilbur and Array Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submit Status Description Wilbur the pig is tinkering with arrays again. He has the array a1, a2, ..., an initially consisting of n zeros. At one step, he c…
Guess a number! Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submit Status Description A TV show called "Guess a number!" is gathering popularity. The whole Berland, the old and the young, are watching the sho…
题意:给定一个n*m的矩阵,都是01矩阵,然后每次一个询问,改变一个格的值,然后问你最大有数是多少. 析:就是按他说的模拟,要预处理,只要把每行的最大值记下来,当改变时,再更新这一行的最大值. 代码如下: #include<bits/stdc++.h> using namespace std; const int maxn = 500 + 5; int a[maxn][maxn]; int num[maxn]; int main(){ int n, m, q, x, y; while(cin…
比较简单的模拟,建议使用STL优先队列. 代码如下: #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; #define N 1000010 ]; int outn[N]; priority_queue<int,vector<int>,greater<int> >que; int main()…
D. Vladik and Favorite Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output This is an interactive problem. Vladik has favorite game, in which he plays all his free time. Game field could…
Codeforces 1082B Vova and Trophies https://vjudge.net/problem/CodeForces-1082B 题目: Vova has won nn trophies in different competitions. Each trophy is either golden or silver. The trophies are arranged in a row. The beauty of the arrangement is the le…
A. Buses Between Cities time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output Buses run between the cities A and B, the first one is at 05:00 AM and the last one departs not later than at 11…
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 standard output After the lessons n groups of schoolchildren went outside and decided to visit Polyca…
Saitama accidentally destroyed a hotel again. To repay the hotel company, Genos has volunteered to operate an elevator in one of its other hotels. The elevator is special - it starts on the top floor, can only move down, and has infinite capacity. Fl…
Little girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she starts counting steps from 11 to the number of steps in this stairway. She speaks every number aloud. For example, if she climbs two stairways…