最近转到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. DataRow.RowState 属性

    RowState 的值取决于两个因素:已对该行执行的操作的类型,以及是否已对 DataRow 调用了 AcceptChanges. private void DemonstrateRowState() ...

  2. android 输入法的打开和关闭

    一.打开输入法窗口: InputMethodManager inputMethodManager = (InputMethodManager)  getSystemService(Context.IN ...

  3. 内存对齐-C语言struct内存占用问题

    转1个写的比较全面的. http://hubingforever.blog.163.com/blog/static/17104057920122256134681/ 本文编辑整理自:http://hi ...

  4. 老韩思考:一个卖豆腐的能转行IT吗? 你的卖点在哪里?

    前言: 我带过的学生很多,各行各业都有,泰牛程序员招生消息放出去后,还有一个在菜市场上卖豆腐的也看我的视频教程,决定转换IT行业,我想,北大毕业的可以卖猪肉,那么卖豆腐的为什么就不能从事IT行业呢?那 ...

  5. [Unity菜鸟] Character控制移动

    1. 给角色加角色控制器组件,然后用以下代码可以控制角色移动和跳跃 float speed = 6.0f; float jumpSpeed = 8.0f; float gravity = 20.0f; ...

  6. Socket称"套接字"

    Socket又称"套接字",应用程序通常通过"套接字"向网络发出请求或者应答网络请求. 二.利用Socket建立网络连接的步骤 建立Socket连接至少需要一对 ...

  7. *Linux之rpm命令

    在Linux操作系统中,有一个系统软件包,它的功能类似于Windows里面的“添加/删除程序”,但是功能又比"添加/删除程序"强很多,它就是Red Hat Package Mana ...

  8. apache&nginx资料汇总

    http://liudaoru.iteye.com/blog/336338 aquid:http://os.51cto.com/art/201009/225813.htm 数据库各种讲座:http:/ ...

  9. Linux进程的睡眠和唤醒简析

    COPY FROM:http://www.2cto.com/os/201204/127771.html 1 Linux进程的睡眠和唤醒 在Linux中,仅等待CPU时间的进程称为就绪进程,它们被放置在 ...

  10. QTP10&QTP11&UFT11.5的安装和破解

    QTP10的安装和破解方法 下载QTP10.0并安装. 安装成功后,在C:\Program Files\Common Files\Mercury Interactive下创建文件夹:License M ...