A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to rules of the Berland fashion, a jacket should be fastened by all the buttons except only one, but not necessarily it should be the last one. Also if…
#include <bits/stdc++.h> using namespace std; int a[1005]; int main() { int n; scanf("%d",&n); int sum = 0; int flag; for(int i = 0; i < n; i ++) { scanf("%d",&a[i]); if(a[i]==0){ sum ++; } } if(n == 1) { if(a[0] == 1)…
D. Lakes in Berland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell is either land or…
D. Lakes in Berland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell is either land or…
A. Parliament of Berland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n parliamentarians in Berland. They are numbered with integers from 1 to n. It happened that all parliamen…
B. Ancient Berland Hieroglyphs 题目连接: http://codeforces.com/problemset/problem/164/B Descriptionww.co Polycarpus enjoys studying Berland hieroglyphs. Once Polycarp got hold of two ancient Berland pictures, on each of which was drawn a circle of hierog…