19.11.30联赛 Problem G. Can LYJ Pass The CET-4?

Problem G. Can LYJ Pass The CET-4?

爆long long

int128在Linux上可以编译并且能用。
cin和cout是无法输出__int128的

typedef long long ll;
inline ll pp(ll a, ll b, ll m)
{
    ll c = a*b-(ll)((long double)a*b/m+0.5)*m;
    return c<0 ? c+m : c;  //就是算的a*b%m;
}

题目

Input
There are several test cases.
The first line contains one integer T (1 ≤ 𝑇 ≤ 105
),
indicating the number of the test cases.
Each test case contains three integer a, b, c. (1 ≤ 𝑏 ≤
𝑎 ≤ 1018 1 ≤ 𝑐 ≤ 1018 ), indicating the number of words
he can recite per day and the number of words he
forgets per day and the day left before the CET-4.
There are 3,500 words LYJ needs to recite.
Output
For each test case if LYJ can recite all the words before
the CET-4 just print the minimum day needed to do it or
just print impossible to tell LYJ it’s impossible to do
that.
Sample Input
3
2 1 3500
1 1 3500
2 1 3499
Sample Output
3500
impossible
impossible

AC代码

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
inline ll pp(ll a, ll b, ll m)
{
    ll c = a*b-(ll)((long double)a*b/m+0.5)*m;
    return c<0 ? c+m : c;
}
int main()
{
    long long  t,a,b,c;
    cin>>t;
    while(t--)
    {
        scanf("%lld%lld%lld",&a,&b,&c);
        if(pp(a-b,c,1e18)<3500)cout<<"impossible"<<endl;
        else
        {
            int x=3500.0/(a-b);
            if(3500%(a-b)==0)cout<<x<<endl;
            else cout<<x+1<<endl;
        }
    }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Halcon-19.11.0.0 32位的dll文件是用于Halcon软件的动态链接库。Halcon是一款强大的机器视觉软件,用于图像处理和机器视觉应用开发。dll文件是一种可执行文件,包含了函数和程序代码,可以在应用程序中被动态链接调用。 32位的dll文件表示该文件适用于32位的操作系统和应用程序。它可以在32位的Windows操作系统上使用,并且能够与与其兼容的32位应用程序交互。32位的操作系统和应用程序通常能够在较低配置的计算机上运行,并且具有较好的兼容性。 Halcon-19.11.0.0 32位的dll文件包含了Halcon软件的核心功能和库函数,可以被开发人员用来构建自己的应用程序。它提供了丰富的图像处理和机器视觉算法,例如图像滤波、特征提取、形状识别等。通过调用这些函数,开发人员能够快速实现图像处理和机器视觉应用的开发,提高工作效率。 使用Halcon-19.11.0.0 32位的dll文件,开发人员可以在自己的应用程序中集成Halcon的功能,实现图像处理和机器视觉的自动化任务。他们可以通过编程语言,如C++、C#等,调用这些dll文件中的函数,控制Halcon的各种操作,包括图像采集、图像处理和结果分析等。 总之,Halcon-19.11.0.0 32位的dll文件是Halcon软件的一部分,用于在32位操作系统和应用程序中实现图像处理和机器视觉应用开发。它能够帮助开发人员快速构建自己的应用程序,提高工作效率和准确性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值