QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#325019#5602. Sun and Moonthanhha1210WA 1ms3604kbC++17334b2024-02-11 03:11:492024-02-11 03:11:50

Judging History

你现在查看的是最新测评结果

  • [2024-02-11 03:11:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3604kb
  • [2024-02-11 03:11:49]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    int ds, ys, dm, ym;
    cin >> ds >> ys;
    cin >> dm >> ym;
    // ds * year - ys = ym *year2 - dm 
    for (int i = 1; i < 5000; i++) {
        if ((ys * i - ds + dm) % ym == 0)
            cout << ys * i - ds;
            break;
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3604kb

input:

3 10
1 2

output:

7

result:

ok single line: '7'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3528kb

input:

27 32
39 41

output:


result:

wrong answer 1st lines differ - expected: '453', found: ''