最近转到vim上来了,用vim编写代码,用gcc编译,用gdb调试。这是用vim做的第一道题,纪念下。题目很水,就不说了。

  1. /*
  2. * Author : ben
  3. */
  4. #include <cstdio>
  5. #include <cstdlib>
  6. #include <cstring>
  7. #include <cmath>
  8. #include <ctime>
  9. #include <iostream>
  10. #include <algorithm>
  11. #include <queue>
  12. #include <set>
  13. #include <map>
  14. #include <stack>
  15. #include <string>
  16. #include <vector>
  17. #include <deque>
  18. #include <list>
  19. #include <functional>
  20. #include <numeric>
  21. #include <cctype>
  22. using namespace std;
  23.  
  24. int getB(int a, int b, int A) {
  25. int B = ;
  26. while(A > ) {
  27. B += A / a + ;
  28. A -= b;
  29. }
  30. return B - ;
  31. }
  32. int main() {
  33. #ifndef ONLINE_JUDGE
  34. freopen("data.in", "r", stdin);
  35. #endif
  36. int a, b;
  37. int A, B;
  38. while(scanf("%d %d", &a, &b) == ) {
  39. if(a > b) {
  40. a = a ^ b;
  41. b = a ^ b;
  42. a = a ^ b;
  43. }
  44. A = (a - ) * (b - ) - ;
  45. B = getB(a, b, A);
  46. B = A - B;
  47. printf("%d %d\n", A, B);
  48. }
  49. return ;
  50. }

hdu1792 水题的更多相关文章

  1. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  2. ACM :漫漫上学路 -DP -水题

    CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit ...

  3. ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)

    1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[ ...

  4. [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 ...

  5. gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,

    1195: 相信我这是水题 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 821  Solved: 219 Description GDUT中有个风云人 ...

  6. BZOJ 1303 CQOI2009 中位数图 水题

    1303: [CQOI2009]中位数图 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 2340  Solved: 1464[Submit][Statu ...

  7. 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题

    B - 大还是小? Time Limit:5000MS     Memory Limit:65535KB     64bit IO Format: Description 输入两个实数,判断第一个数大 ...

  8. ACM水题

    ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...

  9. CF451C Predict Outcome of the Game 水题

    Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...

随机推荐

  1. java 写文本文件

    code 1:将特定String写入特定文件,不覆盖. import java.io.*; import java.util.*; public class OutputLog { public st ...

  2. 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 ...

  3. *[hackerrank]Volleyball Match

    https://www.hackerrank.com/contests/w1/challenges/volleyball-match 此题不错,首先可以看出是DP,S(x, y)= S(x - 1, ...

  4. C语言中volatile关键字的作用

    http://blog.csdn.net/tigerjibo/article/details/7427366#comments 一.前言 1.编译器优化介绍: 由 于内存访问速度远不及CPU处理速度, ...

  5. 转载CSDN (MVC WebAPI 三层分布式框架开发)

    前言:SOA(面向服务的架构)是目前企业应用开发过程中普遍采用的技术,基于MVC WebAPI三层分布式框架开发,以此适用于企业信息系统的业务处理,是本文论述的重点.此外,插件技术的应用,富客户端JQ ...

  6. ScannerDemo------string int

    import java.util.Scanner;                                                /** *Scanner演示 */ public cl ...

  7. apk反编译(6)ProGuard 工具 android studio版官方教程[作用,配置,解混淆,优化示例]

    ProGuard In this document Enabling ProGuard (Gradle Builds) Configuring ProGuard Examples Decoding O ...

  8. 1137. Bus Routes(dfs)

    1137 做过一样的 怎么又忘了 再一次搜超时 不用回溯 #include <iostream> #include<cstdio> #include<cstring> ...

  9. adb shell settings ....

    Android4.2的源码android-17\com\android\commands目录下较之前的版本多了一个settings命令,查看其中的SettingsCmd.java文件,末尾有命令的帮助 ...

  10. Java与正则表达式

    Java与正则表达式 标签: Java基础 正则 正如正则的名字所显示的是描述了一个规则, 通过这个规则去匹配字符串. 学习正则就是学习正则表达式的语法规则 正则语法 普通字符 字母, 数字, 汉字, ...