Codeforces 811 A Vladik and Courtesy
来源:互联网 发布:ubuntu des 解密 编辑:程序博客网 时间:2024/05/21 14:07
题目地址:http://codeforces.com/contest/811/problem/A
题解:就是直接模拟就好了,减的个数依次递增直到减不了,输出对应的字符串
#include <iostream>#include <cstring>#include <string>#include <vector>#include <queue>#include <map>#include <algorithm>#define N 100010#define inf 0x3f3f3f3f#define LL long longusing namespace std;const LL mod = 1e9 + 7;int main() { cin.sync_with_stdio(false); int a, b; while (cin >> a >> b) { int ans=1; int flag = 1; while (a >= ans) { flag = 2; a -= ans; ans++; if (b < ans) { break; } b -= ans; ans++; flag = 1; } if (flag == 1) { cout << "Vladik" << endl; } else { cout << "Valera" << endl; } } return 0;}
阅读全文
1 0
- Codeforces 811A Vladik and Courtesy
- codeforces 811A Vladik and Courtesy
- Codeforces 811 A Vladik and Courtesy
- codeforces——811A——Vladik and Courtesy
- codeforces #416 div2 811A-Vladik and Courtesy
- A. Vladik and Courtesy
- A. Vladik and Courtesy
- A. Vladik and Courtesy
- Codefoces-811A 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 811A ——Vladik and Courtesy——暴力,模拟
- A. Vladik and Courtesy(思维题)
- Vladik and Courtesy
- CodeForce 416 (Div. 2) A. Vladik and Courtesy
- #416 Div.2 A. Vladik and Courtesy-water
- 【35.02%】【codeforces 734A】Vladik and flights
- 中国剩余定理
- bzoj1726 [Usaco2006 Nov]Roadblocks第二短路
- 学习
- kotlin汇总10-Java调用kotlin
- 通过Spring @PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作
- Codeforces 811 A Vladik and Courtesy
- IPC之消息队列
- RadioButton和CheckBox的区别及使用场景
- gVim打造成成IDE
- 创建进程程序-2.主函数
- 【iOS沉思录】GCD实现线程同步的方法
- BlockingQueue之PriorityBlockingQueue要点详解
- springboot使用thymeleaf 解析异常
- zabbix3.2监控JVM状态