NOIP2010 提高组 机器翻译
2014-05-27 15:11
225 查看
题目:http://www.tsinsen.com/ViewGProblem.page?gpid=A1182
解析:题目比较简单,应用了对列(数组模拟)
评测:
![](http://images.cnitblog.com/i/373935/201405/271510066973366.jpg)
解析:题目比较简单,应用了对列(数组模拟)
评测:
![](http://images.cnitblog.com/i/373935/201405/271510066973366.jpg)
/* * ===================================================================================== * * Filename: Noip2010jiqifanyi.c * * Description: RT * * Version: 1.0 * Created: 2014-05-27 14:25:14 * Revision: none * Compiler: gcc * * Author: Rainboy (mn), 597872644@qq.com * Company: NONE * * ===================================================================================== */ #include <stdio.h> int M,N; int queue[1001]= {0}; int article[1001]= {0}; int head=0,tail=0; int main(int argc, const char *argv[]) { int i,j,Bfind,count=0; scanf("%d%d",&M,&N); for (i = 0; i < N; i++) { scanf("%d",&article[i]); } queue[head] = article[0]; count = 1; for (i = 0; i < N; i++) { Bfind = 0; for (j = head; j <= tail; j++) { if (queue[j] == article[i]) { Bfind = 1; break; } } if(!Bfind) { if ((tail-head+1) == M) { tail++; head++; count++; queue[tail]=article[i]; } else { tail++; count++; queue[tail] = article[i]; } } } printf("%d\n",count); return 0; }
相关文章推荐
- [NOIP2010] 提高组 洛谷P1540 机器翻译
- NOIP2010 提高组 复赛 translate 机器翻译
- NOIP 提高组 2010 机器翻译
- NOIP2010提高组 机器翻译 -SilverN
- 机器翻译 (NOIP2010)复赛 提高组 试题一 解题代码
- luogu1540 noip提高组2010机器翻译
- P1540 机器翻译 NOIP2010提高D1
- noip2010初赛提高组 试题详解
- 【NOIP2010提高组】引水入城
- NOIP2010提高组复赛试题
- NOIP2010提高组 关押罪犯 -SilverN
- C++——NOIP动态规划例题——乌龟棋【NOIP2010提高组】
- 关押罪犯 (NOIP2010)复赛 提高组 试题三 解题代码
- 【NOIP2010提高组】乌龟棋(动态规划)
- 题解【luoguP1525 NOIp提高组2010 关押罪犯】
- NOIP2010提高组] CODEVS 1069 关押罪犯(并查集)
- [NOIP2010]机器翻译,乌龟棋,关押罪犯,引水入城
- ACM 简单DP NOIP2010提高组 乌龟棋
- noip2010提高组3题题解 by rLq
- 4.引水入城 (NOIP2010)复赛 提高组 试题四 解题代码