hdu1792 水题
最近转到vim上来了,用vim编写代码,用gcc编译,用gdb调试。这是用vim做的第一道题,纪念下。题目很水,就不说了。
- /*
- * Author : ben
- */
- #include <cstdio>
- #include <cstdlib>
- #include <cstring>
- #include <cmath>
- #include <ctime>
- #include <iostream>
- #include <algorithm>
- #include <queue>
- #include <set>
- #include <map>
- #include <stack>
- #include <string>
- #include <vector>
- #include <deque>
- #include <list>
- #include <functional>
- #include <numeric>
- #include <cctype>
- using namespace std;
- int getB(int a, int b, int A) {
- int B = ;
- while(A > ) {
- B += A / a + ;
- A -= b;
- }
- return B - ;
- }
- int main() {
- #ifndef ONLINE_JUDGE
- freopen("data.in", "r", stdin);
- #endif
- int a, b;
- int A, B;
- while(scanf("%d %d", &a, &b) == ) {
- if(a > b) {
- a = a ^ b;
- b = a ^ b;
- a = a ^ b;
- }
- A = (a - ) * (b - ) - ;
- B = getB(a, b, A);
- B = A - B;
- printf("%d %d\n", A, B);
- }
- return ;
- }
hdu1792 水题的更多相关文章
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- ACM :漫漫上学路 -DP -水题
CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ...
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ...
- [poj2247] Humble Numbers (DP水题)
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ...
- ACM水题
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...
- CF451C Predict Outcome of the Game 水题
Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...
随机推荐
- java 写文本文件
code 1:将特定String写入特定文件,不覆盖. import java.io.*; import java.util.*; public class OutputLog { public st ...
- Project Euler 88:Product-sum numbers 积和数
Product-sum numbers A natural number, N, that can be written as the sum and product of a given set o ...
- *[hackerrank]Volleyball Match
https://www.hackerrank.com/contests/w1/challenges/volleyball-match 此题不错,首先可以看出是DP,S(x, y)= S(x - 1, ...
- C语言中volatile关键字的作用
http://blog.csdn.net/tigerjibo/article/details/7427366#comments 一.前言 1.编译器优化介绍: 由 于内存访问速度远不及CPU处理速度, ...
- 转载CSDN (MVC WebAPI 三层分布式框架开发)
前言:SOA(面向服务的架构)是目前企业应用开发过程中普遍采用的技术,基于MVC WebAPI三层分布式框架开发,以此适用于企业信息系统的业务处理,是本文论述的重点.此外,插件技术的应用,富客户端JQ ...
- ScannerDemo------string int
import java.util.Scanner; /** *Scanner演示 */ public cl ...
- apk反编译(6)ProGuard 工具 android studio版官方教程[作用,配置,解混淆,优化示例]
ProGuard In this document Enabling ProGuard (Gradle Builds) Configuring ProGuard Examples Decoding O ...
- 1137. Bus Routes(dfs)
1137 做过一样的 怎么又忘了 再一次搜超时 不用回溯 #include <iostream> #include<cstdio> #include<cstring> ...
- adb shell settings ....
Android4.2的源码android-17\com\android\commands目录下较之前的版本多了一个settings命令,查看其中的SettingsCmd.java文件,末尾有命令的帮助 ...
- Java与正则表达式
Java与正则表达式 标签: Java基础 正则 正如正则的名字所显示的是描述了一个规则, 通过这个规则去匹配字符串. 学习正则就是学习正则表达式的语法规则 正则语法 普通字符 字母, 数字, 汉字, ...