codeforces-Coder-Strike 2014 - Finals (online edition, Div. 2)
来源:互联网 发布:python区不区分大小写 编辑:程序博客网 时间:2024/05/04 18:37
A. Pasha and Hamsters 模拟
#include <stdio.h>#include <string.h>int l1[101];int l2[101];int main(){ memset(l1,0,sizeof (l1)); memset(l2,0,sizeof (l2)); int n,a,b,i,t; scanf ("%d%d%d",&n,&a,&b); for (i = 0;i < a;i++) { scanf ("%d",&t); l1[t] = 1; } for (i = 0;i < b;i++) { scanf ("%d",&t); l2[t] = 1; } for (i = 1;i <= n;i++) { if (l1[i]) printf ("1"); else if (l2[i]) printf ("2"); if (i < n) printf (" "); else printf ("\n"); } return 0;}
B. Start Up 镜像回文
#include <stdio.h>#include <string.h>char s[1000000];int zmpd (char c){ if (c == 'A' || c == 'H' || c == 'I' || c == 'M' || c == 'O' || c == 'T' || c == 'U' || c == 'V' || c == 'W' || c == 'X' || c == 'Y') return 1; return 0;}int huiwenpd (char s[],int len){ int m = len / 2; for (int i = 0;i < m;i++) if (s[i] != s[len - i - 1]) return 0; return 1;}int main(){ int tf = 1; scanf ("%s",s); char *p = s; while (*p != '\0') { tf = zmpd (*p); if (!tf) break; p++; } if (tf) tf = huiwenpd(s,strlen (s)); if (tf) puts ("YES"); else puts("NO"); return 0;}
0 0
- codeforces-Coder-Strike 2014 - Finals (online edition, Div. 2)
- Codeforces Coder-Strike 2014 - Finals (online edition, Div. 1)
- Coder-Strike 2014 - Finals (online edition, Div. 2) Online Meeting
- Coder-Strike 2014 - Finals (online edition, Div. 2) Online Meeting
- Coder-Strike 2014 - Finals (online edition, Div. 2)
- Coder-Strike 2014 - Finals (online edition, Div. 2 A、B)
- Coder-Strike 2014 - Finals (online edition, Div. 2)
- Coder-Strike 2014 - Finals (online edition, Div. 2)AB
- Coder-Strike 2014 - Finals (online edition, Div. 1)
- Coder-Strike 2014 - Finals (online edition, Div. 2) D.Bug in Code
- Coder-Strike 2014 - Finals (online edition, Div. 2)——Bug in Code
- Coder-Strike 2014 - Finals (online edition, Div. 1)-a-b-c
- Coder-Strike 2014 - Finals (online edition, Div. 1) C. Bug in Code
- Coder-Strike 2014 - Finals Div 2
- Coder-Strike 2014 - Finals (Div. 2) A. Pasha and Hamsters
- Coder-Strike 2014 - Finals ( Div. 2) B. Start Up
- Codeforces Coder-Strike 2014 (Div. 2) C: Online Meeting 来得最早走得最晚的leader
- 【Codeforces】【Coder-Strike 2014 - Finals】【D Bug in Code】
- public String selectCoursePre() throws Exception
- wordpress初尝试
- Customer的bean类
- C语言中常犯的一个错误
- 学习指针不可少的好文章
- codeforces-Coder-Strike 2014 - Finals (online edition, Div. 2)
- HibernateDaoSupport类
- xml中的部分代码:
- C语言文件操作函数大全
- JUnit 4入门
- 一直都在奔跑
- Talking about the DDoS attack in the Internet
- 理解Java NIO
- Button的setBackground方法