最近转到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 水题的更多相关文章

  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. [主席树]HDOJ4348 To the moon

    题意:n个数, m个操作 1. C l r d  给[l, r]区间的每个数加上d2. Q l r:   查询[l, r]区间的和3. H l r t: 查询第t个操作时[l, r]区间的和4. B ...

  2. 2014--9=17 软工二班 MyEclipse blue==5

    package cn.rwkj.test; import java.io.IOException; import java.io.InputStream; import java.io.OutputS ...

  3. ArcEngine查询、添加、删除要数的方法

    原文地址:http://www.cnblogs.com/caodajieup/archive/2011/11/02/2232658.html 1.查找数据 1).利用FeaturCursor进行空间查 ...

  4. PCL—低层次视觉—点云分割(RanSaC)

    点云分割 点云分割可谓点云处理的精髓,也是三维图像相对二维图像最大优势的体现.不过多插一句,自Niloy J Mitra教授的Global contrast based salient region ...

  5. jQuery EasyUI - Add link to datagrid cell

    Extracted from: http://stackoverflow.com/questions/16061894/jquery-easyui-add-link-to-cell HTML: < ...

  6. ZOJ 3790 Consecutive Blocks (离散化 + 暴力)

    题目链接 虽然是一道暴力的题目,但是思路不好想.刚开始还超时,剪枝了以后1200ms,不知道为什么还是这么慢. 题意:给你n个点,每个点有一种颜色ci,给你至多k次删除操作,每次删除一个点,问最多k次 ...

  7. LA 3295 (计数 容斥原理) Counting Triangles

    如果用容斥原理递推的办法,这道题确实和LA 3720 Highway很像. 看到大神们写的博客,什么乱搞啊,随便统计一下,这真的让小白很为难,于是我决定用比较严格的语言来写这篇题解. 整体思路很简单: ...

  8. Jqgrid入门-操作表格的数据(二)

    上一篇中,Jqgrid已经可以从服务端获得数据,并显示在Grid表格中了.下面说一下,如何操作表格及其数据.           jqGrid有很多方法函数,用来操作数据或者操作Grid表格本身.jq ...

  9. [转] jQuery Infinite Ajax Scroll(ias) 分页插件介绍

    原文链接:http://justflyhigh.com/index.php/articlec/index/index.php?s=content&m=aticle&id=91 Infi ...

  10. [转] Jquery滚动加载

    原文地址:http://hi.baidu.com/vipxiaofan/item/9eb927b795671f77254b0985 另外一个asp.net的例子:http://blog.csdn.ne ...