H-Fashion in Berland】的更多相关文章

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…
题目链接: A. Fashion in Berland 题意: 思路: AC代码: //#include <bits/stdc++.h> #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; #define For(i,j,n) for(int i=j;i&l…
题目链接: http://codeforces.com/problemset/problem/691/A 题目大意: n个数0或1,要求恰好n-1个1,如果n为1则那个数一定要是1 题目思路: [模拟] 水题一道.看错题目两次.. // //by coolxxx //#include<bits/stdc++.h> #include<iostream> #include<algorithm> #include<string> #include<ioman…
水题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #include<algorithm> #include<vector> #include<map> #include<set> #in…
A - Fashion in Berland 水 // #pragma comment(linker, "/STACK:102c000000,102c000000") #include <iostream> #include <cstdio> #include <cstring> #include <sstream> #include <string> #include <algorithm> #include &…
#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…