A

http://codeforces.com/contest/560/problem/A

推断给出的数能否组成全部自然数。

水题


int a[1010];
bool b[1000010]; int main()
{
int n;
while (scanf("%d", &n) != EOF)
{
memset(b,false,sizeof(b));
for (int i = 1; i <= n; i++)
{
scanf("%d", &a[i]);
b[a[i]] = true;
}
int ans = 0;
if (b[1] == false) ans = 1;
else if (b[1]) ans = -1; printf("%d\n",ans);
}
return 0;
}

B

http://codeforces.com/contest/560/problem/B

推断一个矩形能否装下另外两个矩形


int a1, a2, a3, b1, b2, b3; int main()
{
while (scanf("%d%d%d%d%d%d", &a1, &b1, &a2, &b2, &a3, &b3) != EOF)
{
int ok = 0; int t1 = max(b2, b3);
int r1 = max(a2, a3); if ((t1 <= a1 && (a2 + a3) <= b1)) ok = 1;
if ((t1 <= b1 && (a2 + a3) <= a1)) ok = 1;
if ((r1 <= a1 && (b2 + b3) <= b1)) ok = 1;
if ((r1 <= b1 && (b2 + b3) <= a1)) ok = 1; int t11 = max(b2, a3);
int r11 = max(a2, b3); if ((r11 <= a1 && (b2 + a3) <= b1)) ok = 1;
if ((r11 <= b1 && (b2 + a3) <= a1)) ok = 1;
if ((t11 <= a1 && (a2 + b3) <= b1)) ok = 1;
if ((t11 <= b1 && (a2 + b3) <= a1)) ok = 1; if (ok) puts("YES");
else puts("NO");
}
return 0;
}

C

http://codeforces.com/contest/560/problem/C

推断组成六边形须要的三角形个数

int a, b, c, d, e, f;

int main()
{
while (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF)
{
printf("%d\n", (a + b + c)*(a + b + c) - (a*a + c*c + e*e));
}
return 0;
}

Codeforces Round #313 (Div. 2) ABC的更多相关文章

  1. Codeforces Round #366 (Div. 2) ABC

    Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...

  2. Codeforces Round #247 (Div. 2) ABC

    Codeforces Round #247 (Div. 2) http://codeforces.com/contest/431  代码均已投放:https://github.com/illuz/Wa ...

  3. Codeforces Round #313 (Div. 1)

    官方英文题解:http://codeforces.com/blog/entry/19237 Problem A: 题目大意: 给出内角和均为120°的六边形的六条边长(均为正整数),求最多能划分成多少 ...

  4. dp - Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess

    Gerald and Giant Chess Problem's Link: http://codeforces.com/contest/559/problem/C Mean: 一个n*m的网格,让你 ...

  5. Codeforces Round #313 (Div. 1) B. Equivalent Strings

    Equivalent Strings Problem's Link: http://codeforces.com/contest/559/problem/B Mean: 给定两个等长串s1,s2,判断 ...

  6. Codeforces Round #313 (Div. 1) A. Gerald's Hexagon

    Gerald's Hexagon Problem's Link: http://codeforces.com/contest/559/problem/A Mean: 按顺时针顺序给出一个六边形的各边长 ...

  7. Codeforces Round #313 (Div. 2)B.B. Gerald is into Art

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/ ...

  8. Codeforces Round #313 (Div. 2) D. Equivalent Strings

    D. Equivalent Strings Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/ ...

  9. Codeforces Round #313 (Div. 2) C. Gerald's Hexagon 数学

    C. Gerald's Hexagon Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/pr ...

随机推荐

  1. dubbo Protocol实现剖析

    title: dubbo Protocol实现剖析 date: 2018-09-09 19:10:07 tags: --- 2.6.3版本,之前读的是2.4.9版本 本篇主要阐述dubbo rpc的c ...

  2. 台州学院we are without brain 训练 计算几何

    A - View Angle Flatland has recently introduced a new type of an eye check for the driver's licence. ...

  3. 配置CORS解决跨域调用—反思思考问题的方式

    导读:最近都在用一套完整的Java EE的体系做系统,之前都是用spring框架,现在弄这个Java EE,觉得新鲜又刺激.但,由于之前没有过多的研究和使用,在应用的过程中,也出现了不少的问题.累积了 ...

  4. 【bzoj3291】Alice与能源计划 模拟费用流+二分图最大匹配

    题目描述 在梦境中,Alice来到了火星.不知为何,转眼间Alice被任命为火星能源部长,并立刻面临着一个严峻的考验. 为了方便,我们可以将火星抽象成平面,并建立平面直角坐标系.火星上一共有N个居民点 ...

  5. formData使用总结

    1.formData基本使用 //可以从form元素初始化一个FormData对象,或者new一个空对象 var formData = new FormData([fromElement]); //可 ...

  6. linux--bash: redis-server: 未找到命令

    linux 安装redis过程中出现了异常,make不通过,异常如下: [root@localhost redis-2.8.3]# make cd src && make all ma ...

  7. hdu 3264 圆的交+二分

    Open-air shopping malls Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/ ...

  8. windows.open 以post的方式传递参数

    今天看到有篇文章寫到 windows.open 可以post方式傳遞參數,就趕緊照作看看,結果是可行的,感謝撰寫這篇文章的作者~ /** * window.open with post method  ...

  9. 转 整理 Linux服务器部署系列之一—Apache篇

    花了差不多一天,参考了几个博客,终于初步配成功了 Apache,先总结一下: 如果apache安装成为linux的服务的话,可以用以下命令操作: service httpd start 启动 serv ...

  10. Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

    ubuntu上安装Apache2时出现错误 Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0: ...