Petya is having a party soon, and he has decided to invite his nn friends. He wants to make invitations in the form of origami. For each invitation, he needs two red sheets, five green sheets, and eight blue sheets. The store sells an infinite number…
A. Petya and Origamitime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya is having a party soon, and he has decided to invite his n friends. He wants to make invitations in the form of origami. Fo…
A. Petya and Origami Water. #include <bits/stdc++.h> using namespace std; #define ll long long ll n, k; ll Get(ll x) { ? (x * n) / k : (x * n) / k + ; } int main() { while (scanf("%lld%lld", &n, &k) != EOF) { ll res = Get() + Get()…
A. Petya and Origami time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Petya is having a party soon, and he has decided to invite his nn friends. He wants to make invitations in the form…
http://codeforces.com/contest/111/problem/D Little Petya loves counting. He wants to count the number of ways to paint a rectangular checkered board of size n × m (n rows, m columns) in k colors. Besides, the coloring should have the following proper…
网址:http://codeforces.com/contest/576/problem/A A. Vasya and Petya's Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya and Petya are playing a simple game. Vasya thought of number x…
B. Petya and Divisors Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/111/problem/B Description Little Petya loves looking for numbers' divisors. One day Petya came across the following problem: You are given n queries in t…
A. Petya and Inequiations Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/111/problem/A Description Little Petya loves inequations. Help him find n positive integers a1, a2, ..., an, such that the following two conditions a…
C. Vasya and Petya's Game Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/577/problem/C Description Vasya and Petya are playing a simple game. Vasya thought of number x between 1 and n, and Petya tries to guess the number. P…
C. Petya and Catacombstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is…
补的若干年以前的题目,水题,太菜啦_(:з」∠)_ B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks see…
Petya studies at university. The current academic year finishes with nn special days. Petya needs to pass mm exams in those special days. The special days in this problem are numbered from 11 to nn. There are three values about each exam: sisi — the…
A very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is just walking through the catacombs. Catacombs consist of several rooms and bidirectional passages between some pairs of the…
D. Petya and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya has an array aa consisting of nn integers. He has learned partial sums recently, and now he can calculate the sum o…
题目描述 A very brave explorer Petya once decided to explore Paris catacombs. Since Petya is not really experienced, his exploration is just walking through the catacombs. Catacombs consist of several rooms and bidirectional passages between some pairs o…
It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he thinks he lacks time to finish them all, so he asks you to help with one.. There is a glob pattern in the statements (a string consis…
突然发现百度不到这题的单独题解(果然是因为这是水题么),那我就来写一个了~ 先把题给贴了. C. Petya and Catacombs time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A very brave explorer Petya once decided to explore Paris catacombs. Sin…
G - Petya and Graph 思路: 最大权闭合子图 对于每条边,如果它选了,那么它连的的两个点也要选 边权为正,点权为负,那么就是求最大权闭合子图 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define pi ac…