B

判矩阵的时候 出了点错 根据点积判垂直 叉积判平行 面积不能为0

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<cmath>
using namespace std;
struct node
{
int x,y;
}p[];
int f[];
int find(node a,node b,node c,node d)
{
int flag = ;
if(a.x-b.x==||c.y-b.y==||c.x-d.x==||d.y-a.y==)
return ;
if((a.x-b.x)*(b.x-c.x)+(a.y-b.y)*(b.y-c.y)==&&(a.x-b.x)*(d.y-c.y)==(a.y-b.y)*(d.x-c.x)&&(a.x-d.x)*(b.y-c.y)==(a.y-d.y)*(b.x-c.x))
flag = ;
if(flag&&abs(a.x-b.x)==abs(c.y-b.y))
flag = ;
return flag;
}
int judge(node a,node b,node c,node d)
{
struct node q[];
q[] = a;q[] = b;
q[] = c;q[] = d;
int i,j,g,o;
int flag = ;
for(i = ; i <= ; i++)
for(j = ; j <= ; j++)
{
if(j==i) continue;
for(g = ; g <= ; g++)
{
if(g==i||g==j) continue;
for(o = ; o <= ; o++)
{
if(o==i||o==g||o==j) continue;
int gg = find(q[i],q[j],q[g],q[o]);
if(gg==)
{
flag = ;
return flag;
}
else if(gg==)
{
flag = ;
}
}
}
}
return flag;
}
int main()
{
int i,j,k,o,g;
while(cin>>p[].x>>p[].y)
{
memset(f,,sizeof(f));
int flag = ;
for(i = ; i <= ; i++)
cin>>p[i].x>>p[i].y;
for(i = ;i <= ; i++)
{
for(j = ;j <= ; j++)
{
if(j==i) continue;
for(k =; k <= ; k++)
{
if(k==i||k==j) continue;
for(o = ; o <= ; o++)
{
if(o==k||o==j||o==i) continue;
if(judge(p[i],p[j],p[k],p[o])!=) continue;
int kk=;
for(g = ; g <= ; g++)
{
if(g!=i&&g!=j&&g!=k&&g!=o)
f[++kk] = g;
}
if(judge(p[f[]],p[f[]],p[f[]],p[f[]]))
{
flag = ;
break;
}
}
if(flag) break;
}
if(flag) break;
}
if(flag) break;
}
if(flag)
{
puts("YES");
int kk=;
cout<<i<<" "<<j<<" "<<k<<" "<<o<<endl;
cout<<f[]<<" "<<f[]<<" "<<f[]<<" "<<f[]<<endl;
}
else
puts("NO");
}
return ;
}

C

分各种情况讨论 注意左边为高位

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<cmath>
using namespace std;
#define N 100010
char s[N],ss[N];
int main()
{
int i,k;
cin>>s;
k = strlen(s);
int num = ,a=,b=,o1=-,o2=-,o3=-;
for(i = ; i < k; i++)
{
if(s[i]=='?'){num++;o1=i;}
if(s[i]==''){a++;o2=i;}
if(s[i]==''){b++;o3 = i;}
}
int kk = (k-)/;
if(num==)
{
if(b<=kk)
puts("");
else if(b-kk==)
{
if(s[k-]=='')
puts("");
else
puts("");
}
else
puts("");
}
else
{
if(b+num<=kk)
puts("");
else if(b+num-kk==)
{
if(o1>o2||o3>o2)
{
puts("");
puts("");
}
else
{
puts("");
puts("");
}
}
else
{
if(b-kk>=)
puts("");
else if(b-kk==)
{
if(o3>o2&&o3>o1)
{
puts("");
puts("");
}
else
{
puts("");
puts("");
}
}
else
{
if(o1>o2&&o1>o3)
{
puts("");
puts("");
puts("");
puts("");
}
else if(o2>o3&&o2>o1)
{
puts("");
puts("");
puts("");
}
else
{
puts("");
puts("");
puts("");
}
}
}
}
return ;
}

Codeforces Beta Round #97 (Div. 1)的更多相关文章

  1. Codeforces Beta Round #97 (Div. 1) C. Zero-One 数学

    C. Zero-One 题目连接: http://codeforces.com/contest/135/problem/C Description Little Petya very much lik ...

  2. Codeforces Beta Round #97 (Div. 1) B. Rectangle and Square 暴力

    B. Rectangle and Square 题目连接: http://codeforces.com/contest/135/problem/B Description Little Petya v ...

  3. Codeforces Beta Round #97 (Div. 1) A. Replacement 水题

    A. Replacement 题目连接: http://codeforces.com/contest/135/problem/A Description Little Petya very much ...

  4. Codeforces Beta Round #97 (Div. 2)

    A题求给出映射的反射,水题 #include <cstdio> int x,ans[105],n; int main(){ scanf("%d",&n); fo ...

  5. Codeforces Beta Round #80 (Div. 2 Only)【ABCD】

    Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一 ...

  6. Codeforces Beta Round #83 (Div. 1 Only)题解【ABCD】

    Codeforces Beta Round #83 (Div. 1 Only) A. Dorm Water Supply 题意 给你一个n点m边的图,保证每个点的入度和出度最多为1 如果这个点入度为0 ...

  7. Codeforces Beta Round #79 (Div. 2 Only)

    Codeforces Beta Round #79 (Div. 2 Only) http://codeforces.com/contest/102 A #include<bits/stdc++. ...

  8. Codeforces Beta Round #77 (Div. 2 Only)

    Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h ...

  9. Codeforces Beta Round #76 (Div. 2 Only)

    Codeforces Beta Round #76 (Div. 2 Only) http://codeforces.com/contest/94 A #include<bits/stdc++.h ...

随机推荐

  1. mongo 1067错误

    对mongo进行错误的操作导致mongo服务异常关闭,当重启mongo服务时出现1067错误此时在data目录下产生mongod.lock文件,可以讲此文件删除,然后重启就可以了 Please mak ...

  2. HTTP persistent connection

    http://en.wikipedia.org/wiki/HTTP_persistent_connection

  3. delphi中locate方法

    TDataSet控件以及它的继承控件,例如TSimpleDataSet/TClientDataSet等都可以使用Locate方法在结果数据集中查寻数据.程序首先必须使用SQL命令从后端数据库中取得数据 ...

  4. HDU 2126 Buy the souvenirs (01背包,输出方案数)

    题意:给出t组数据 每组数据给出n和m,n代表商品个数,m代表你所拥有的钱,然后给出n个商品的价值 问你所能买到的最大件数,和对应的方案数.思路: 如果将物品的价格看做容量,将它的件数1看做价值的话, ...

  5. Android的Testing和Instrumentation

    Android提供了一系列强大的测试工具,它针对Android的环境,扩展了业内标准的JUnit测试框架.尽管你可以使用JUnit测试Android工程,但Android工具允许你为应用程序的各个方面 ...

  6. Xamarin for Visual Studio 破解日志

    一.相关声明 本文涉及的 Xamarin 系列软件的版权为 Xamarin Inc. 所有 以本文涉及的思路和方法破解的软件,禁止用于商业用途 如无必要,学习和研究时最好以正版为准 团队或土豪等若觉得 ...

  7. linux kill命令详解

    1.命令格式: kill[参数][进程号] 2.命令功能: 发送指定的信号到相应进程.不指定型号将发送SIGTERM(15)终止指定进程.如果任无法终止该程序可用“-KILL” 参数,其发送的信号为S ...

  8. eq相等 ,ne、neq不相等 EL表达式

    eq相等,ne.neq不相等, gt大于, lt小于 gte.ge大于等于   lte.le 小于等于   not非   mod求模   is [not] div by是否能被某数整除   is [n ...

  9. 李洪强iOS经典面试题12

     1.说说响应链 答: 事件响应链.包括点击事件,画面刷新事件等.在视图栈内从上至下,或者从下之上传播. 可以说点事件的分发,传递以及处理.具体可以去看下touch事件这块.因为问的太抽象化了 严重怀 ...

  10. 用httpPost对JSON发送和接收的例子

    HTTPPost发送JSON: private static final String APPLICATION_JSON = "application/json";         ...