暴力能过?
查看原帖
暴力能过?
754021
fish_love_cat楼主2024/8/20 15:50
#include<iostream>
using namespace std;
long long a,b,d=0;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int i=0;
    cin>>a>>b;
    while(d!=1){   
        ++i;
        d=a+d;
        if(d>b){
        while(d>b)d-=b;
        }
    }
    cout<<i;
    return 0;
}

暴力怎么能草过去啊,随便都能卡掉吧,,

Hack:

输入:2 1999999999

输出:1000000000

请求添加数据。

2024/8/20 15:50
加载中...