Codeforces 851A Arpa and a research in Mexican wave
来源:互联网 发布:91家居设计软件 编辑:程序博客网 时间:2024/05/21 08:36
题目链接:CF-851A
挺有意思的一道题,模拟体育场上的人浪,问t时间有多少人是站立的。
直接模拟就可以,中间有一段人数是不变的,只需要考虑刚开始和最后一段时间的人数变化即可。
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#include <string>#include <string.h>using namespace std;int main() {int n, k, t;scanf("%d %d %d", &n, &k, &t);if (t <= k)printf("%d\n", t);else if (t <= n)printf("%d\n", k);else{int s = t - n;printf("%d\n", k - s);}return 0;}
阅读全文
0 0
- Codeforces 851 A Arpa and a research in Mexican wave
- Codeforces 851A Arpa and a research in Mexican wave
- CF 851A Arpa and a research in Mexican wave
- Codeforces 851A . Arpa and a research in Mexican wave 水题
- A. Arpa and a research in Mexican wave
- A. Arpa and a research in Mexican wave
- ACM刷题之codeforce————Arpa and a research in Mexican wave
- Codeforces 851A && Round #432 Div. 2 A. Arpa and a research in Mexic
- Codeforces 851E-Arpa and a game with Mojtaba
- Codeforces 851D. Arpa and a list of numbers
- codeforces 850B Arpa and a list of numbers
- Codeforces Round #432 B. Arpa and a list of numbers
- codeforces 851 D. Arpa and a list of numbers(前缀和+bruteforce)
- Codeforces 851D Arpa and a list of numbers【思维+前缀和】
- Codeforces 851 D. Arpa and a list of numbers(技巧)
- Codeforces 851D Arpa and a list of numbers Round #432 (Div. 2
- Codeforces 851 D Arpa and a list of numbers(前缀和)
- Codeforces 851D Arpa and a list of numbers (枚举+分段)
- ARM汇编指令
- H5~表单
- Redis _ lesson3 redis 常见的5种数据类型 与 常见的Redis-cli 返回值
- Milk Patterns POJ
- 笔试题——同样的字符串存放的位置不同
- Codeforces 851A Arpa and a research in Mexican wave
- struct所占空间的计算
- CentOS6.5下Ambari安装搭建部署大数据集群(图文分五大步详解)(博主强烈推荐)
- 从零开始学会用Python3做捕鱼达人游戏
- 开通空间了!
- 关于讯飞语音合成报MscSpeechLog: onCompleted: 用户校验失败.(错误码:10407)错误
- Lua开发环境搭建
- leetcode 485. Max Consecutive Ones(C语言)
- Ambari安装之Ambari安装前准备(CentOS6.5)(一)