Submission #721467

# Submission time Handle Problem Language Result Execution time Memory
721467 2023-04-11T02:06:35 Z Darren0724 Strange Device (APIO19_strange_device) C++17
0 / 100
2449 ms 2272 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(),x.end()
const int INF=1e18;

int32_t main(){
    int t;cin>>t;
    int a,b;cin>>a>>b;
    int m=0;
    int g=__gcd(a,b+1);
    __int128 tmp=a*b/g;
    if(tmp>INF){
        m=INF;
    }
    else{
        m=tmp;
    }
    for(int i=0;i<t;i++){
        int l,r;cin>>l>>r;
        cout<<min(r-l+1,m)<<endl;
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 26 ms 312 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 3 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 2449 ms 2272 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 2449 ms 2272 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 2449 ms 2272 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 272 ms 676 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 26 ms 312 KB Output isn't correct
3 Halted 0 ms 0 KB -