编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#5420 #1051. 相思树 Wrong Answer 60 32 ms 512 K C++ 17 / 927 B TosakaUCW 2024-04-27 15:44:00
显示原始代码
#include <bits/stdc++.h>
#define int long long

using pii = std::pair<int, int>;
using tuu = std::tuple<int, int, int>;
#define pb push_back

using std::cin, std::cout, std::string, std::vector;
int read(int x = 0, int f = 0, char ch = getchar()) {
    while (ch < 48 or 57 < ch) f = ch == 45, ch = getchar();
    while (48 <= ch and ch <= 57) x = x * 10 + ch - 48, ch = getchar();
    return f ? -x : x;
}
const int N = 1e6 + 5;
// const int INF = 1e18;
int n, m, a[N];
void solve() {
    int A = read(), K = read(), L = read(), R = read();
    int P = 0;
    if (A >= L)
        A = A - K * ((A - L) / K);
    else if (A <= L)
        A = A + K * ((L - A) / K);
    int ans = (R - A) / K + (((R - A) % K == 0));
    // printf("%lld %lld %lld %lld\n", A, K, L, R);
    cout << ans;
}

signed main() {
#ifndef ONLINE_JUDGE
    freopen("D.in", "r", stdin);
#endif
    for (int T = 1; T--; solve())
        ;
    return 0;
}
子任务 #1
Wrong Answer
得分:60
测试点 #1
Accepted
得分:100
用时:3 ms
内存:512 KiB

输入文件(1.in

-2 2 1 1

答案文件(1.out

0

用户输出

0

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:3 ms
内存:380 KiB

输入文件(2.in

-1000000 1 -1000000 1000000

答案文件(2.out

2000001

用户输出

2000001

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:3 ms
内存:276 KiB

输入文件(3.in

-999999 33 -999999 666666

答案文件(3.out

50506

用户输出

50506

系统信息

Exited with return code 0
测试点 #4
Wrong Answer
得分:0
用时:3 ms
内存:384 KiB

输入文件(4.in

64552 8 -914835 382070

答案文件(4.out

162113

用户输出

162112

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:3 ms
内存:384 KiB

输入文件(5.in

449771 10 -994736 308943

答案文件(5.out

130368

用户输出

130367

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #6
Wrong Answer
得分:0
用时:3 ms
内存:348 KiB

输入文件(6.in

518796 6 -235474 891919

答案文件(6.out

187899

用户输出

187898

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:4 ms
内存:384 KiB

输入文件(7.in

0 1000000000 -999999999 -999999999

答案文件(7.out

0

用户输出

0

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:3 ms
内存:236 KiB

输入文件(8.in

1000000000000000000 1 -1000000000000000000 1000000000000000000

答案文件(8.out

2000000000000000001

用户输出

2000000000000000001

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:4 ms
内存:384 KiB

输入文件(9.in

1000000000000000000 1000000000 -1000000000000000000 1000000000000000000

答案文件(9.out

2000000001

用户输出

2000000001

系统信息

Exited with return code 0
测试点 #10
Wrong Answer
得分:0
用时:3 ms
内存:272 KiB

输入文件(10.in

-553548222810233536 554374432 -249328436662217663 672836766307973152

答案文件(10.out

1663433863

用户输出

1663433864

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0