CodeForces 811A ——Vladik and Courtesy——暴力,模拟
来源:互联网 发布:php优势和劣势 知乎 编辑:程序博客网 时间:2024/05/22 05:22
两个人分别有a,b颗糖,第一个人先少一颗,然后第二个人少两颗,然后再第一个人少三颗…………以此类推。。看看谁的糖不够拿了
丢脸的一题。。。。看样例脑补题意失败。。。读错题了。。。刚开始用二分。。。其实直接暴力模拟或者算等差数列就好了。。
#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<cmath>#include<vector>#include<set>#include<map>#include<queue>#include<stack>#define LL long longusing namespace std;const int N = 100010;int main(){ LL a, b; while(scanf("%lld%lld", &a, &b) == 2){ for(LL i = 1; a >= 0 && b >= 0; i ++){ if(i % 2){ a -= i; } else{ b -= i; } } if (a < 0) printf("Vladik\n"); else printf("Valera\n"); } return 0;}
阅读全文
0 0
- CodeForces 811A ——Vladik and Courtesy——暴力,模拟
- codeforces——811A——Vladik and Courtesy
- Codefoces-811A Vladik and Courtesy [模拟]
- Codeforces 811A Vladik and Courtesy
- codeforces 811A Vladik and Courtesy
- Codeforces 811 A Vladik and Courtesy
- codeforces #416 div2 811A-Vladik and Courtesy
- A. Vladik and Courtesy
- A. Vladik and Courtesy
- A. Vladik and Courtesy
- Codeforces Round #416 (Div. 2) A. Vladik and Courtesy
- Codeforces Round #416 (Div. 2) A. Vladik and Courtesy
- Codeforces Round #416 (Div. 2) A. Vladik and Courtesy
- CodeForces 811B——Vladik and Complicated Book ——思维,模拟
- A. Vladik and Courtesy(思维题)
- codeforces 811D——Vladik and Favorite Game(bfs)
- Vladik and Courtesy
- CodeForce 416 (Div. 2) A. Vladik and Courtesy
- linux统计代码行数
- #TensorFlow学习笔记#02 Session的两种运行方式
- [乐意黎原创]centos7.2里开启apache及php错误信息提示
- GPGPU-Sim 之 block调度
- Golang学习笔记 控制流
- CodeForces 811A ——Vladik and Courtesy——暴力,模拟
- JavaMail给QQ邮箱发邮件报错,没有SSL加密
- python socket编程
- 数据库考核要求1
- CMake生成可用gdb调试的可执行文件
- 容器之Collection和Map
- java开发知识点--备忘录
- JAVA开发手册-基础篇-开发规范
- intelliJ IDEA 版本更新后,如何关闭参数提示。