跳过正文
  1. Posts/

codeforces 334 B. Eight Point Sets (暴力)

·1 分钟

题目链接 题意:给出8个点,问能否构成一个8元素集合,使得x1/* *********************************************** Author :111qqz Created Time :2016年03月31日 星期四 13时39分27秒 File Name :code/cf/problem/334B.cpp ************************************************ */

#include #include #include #include #include #include #include #include #include #include #include #include #define fst first #define sec second #define lson l,m,rt«1 #define rson m+1,r,rt«1|1 #define ms(a,x) memset(a,x,sizeof(a)) typedef long long LL; #define pi pair < int ,int > #define MP make_pair

using namespace std; const double eps = 1E-8; const int dx4[4]={1,0,0,-1}; const int dy4[4]={0,-1,1,0}; const int inf = 0x3f3f3f3f; const int N=1E6+7; pi a[N]; set< pi >se;

bool solve() {

1if (a[1].fst==a[2].fst&&a[2].fst==a[3].fst&&a[3].fst!=a[4].fst&&a[4].fst==a[5].fst&&a[5].fst!=a[6].fst&&a[6].fst==a[7].fst&&a[7].fst==a[8].fst&&a[1].sec==a[4].sec&&a[4].sec==a[6].sec&&a[3].sec==a[5].sec&&a[5].sec==a[8].sec&&a[1].sec!=a[2].sec&&a[2].sec==a[7].sec) return true;
2return false;

} int main() {

1#ifndef  ONLINE_JUDGE
2freopen("code/in.txt","r",stdin);

#endif

 1for ( int i = 1 ; i <= 8 ; i++)
 2{
 3    cin>>a[i].fst>>a[i].sec;
 4    se.insert(a[i]);
 5}
 6sort(a+1,a+9);
 7if (solve())
 8{
 9    puts("respectable");
10}
11else
12{
13    puts("ugly");
14}

#ifndef ONLINE_JUDGE fclose(stdin); #endif

1return 0;

}

相关文章

codeforces croc2016 A. Amity Assessment (暴力)

·1 分钟
题目链接 题意:2×2的格子,有三个位置分别放”A“ “B” “C” ,一个位置为空。只有和空位相邻位置上的字母能移动到空位。没有其他移动规则。现在给出两个状态。问能否互相转化。 思路: 貌似可以dfs…?但是一共才2*2,可以直接暴力枚举。 手写一种变换最多能有12种。

codeforces #341 div2 A. Die Roll

·1 分钟
http://codeforces.com/contest/621/problem/A A. Wet Shark and Odd and Even time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Today, Wet Shark is given n integers. Using any of these integers no more than once, Wet Shark wants to get maximum possible even (divisible by 2) sum. Please, calculate this value for Wet Shark.

codeforces #341 div 2 B. Wet Shark and Bishops

·2 分钟
http://codeforces.com/contest/621/problem/B B. Wet Shark and Bishops time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.