小记:long long %I64d

代码:

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm> using namespace std; #define mst(a,b) memset(a,b,sizeof(a))
#define eps 10e-8 const int MAX_ = 10010;
const int N = 100010;
const int INF = 0x7fffffff; int main(){
    long long T, n, m, v, k, pre, cnt;
    scanf("%I64d", &T);
    while(T--){
        scanf("%I64d%I64d%I64d%I64d", &n, &m, &v, &k);
        cnt = 0;
        while(m > -1 && m < n){
            pre = m;
            m = (m - v) * k;
            cnt++;
            if(m <= pre)m = -1;
        }
        if(m < 0){
            cnt = -1;
        }
        printf("%I64d\n", cnt);
    }
    return 0;
}

最新文章

  1. git diff
  2. 【iCore3 双核心板】例程五:SYSTICK定时器实验——定时点亮LED
  3. Qrels supervision information以及document collection,如何划分为train、test,保证test中doc对于train来说是new document
  4. MySQL中varchar类型在5.0.3后的变化
  5. 基于TCP协议的网络通信
  6. Ubuntu CTRL+ALT+F1~F6 进入命令模式后不支持中文显示的解决办法
  7. RxJava开发精要7 – Schedulers-解决Android主线程问题
  8. 使用UIBezierPath和CAShapeLayer画各种图形
  9. select省市联动选择城市 asp.net mvc4
  10. Date时间对象方法
  11. 面试(2)-java-se-HashSet和TreeSet
  12. Andrew Ng机器学习课程笔记--week10(优化梯度下降)
  13. defer 和 async 区别
  14. linux VIM 下的语法高亮及自动缩进
  15. svn的使用教程
  16. How to resize or create a thumbnail image from file stream on UWP
  17. hdu 4432 第37届ACM/ICPC天津现场赛B题
  18. 理解 process.initgroups(user, extra_group)
  19. PYTHON如何降级?
  20. Thread类的常见问题

热门文章

  1. 本地mongochef连接其他计算机上的数据库认证失败解决方法
  2. 网上流行的学生选课相关的50个常用sql语句
  3. C++中 list与vector的区别
  4. 商业计算中Java高精度计算BigDecimal类
  5. js 攻坚克难
  6. Nginx 监控
  7. 多目标跟踪笔记三:Global Data Association for Multi-Object Tracking Using Network Flows
  8. vim使用配置-python
  9. Linux之iptables(二、基本认识和组成)
  10. Git 基础教程 之 标签