QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#95737 | #5602. Sun and Moon | __# | WA | 2ms | 3564kb | C++14 | 1.0kb | 2023-04-11 19:07:00 | 2023-04-11 19:07:00 |
Judging History
answer
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define el '\n'
#define F first
#define S second
typedef long long ll;
typedef long double ld;
bool multipleTestCases = 0, sublime = 0;
const int N = 4e5 + 5, INF = 1e9 + 5, mod = 1e9 + 7, LOG = 22, SQ = 500;
void doWork() {
ll ps, ts, ns, pm, tm, nm;
cin >> ps >> ts >> pm >> tm;
ns = ts - ps;
nm = tm - pm;
ts += ps;
tm += pm;
for (int i = 1; i <= 1e4; i++) {
if (i % ts == ns and i % tm == nm) {
return cout << i << el, void();
}
}
}
signed main() {
#ifdef ONLINE_JUDGE
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#endif
#ifndef ONLINE_JUDGE
if (sublime) {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
#endif
int tests = 1;
if (multipleTestCases) {
cin >> tests;
}
for (int tc = 1; tc <= tests; tc++) {
doWork();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3564kb
input:
3 10 1 2
output:
7
result:
ok single line: '7'
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3440kb
input:
27 32 39 41
output:
1362
result:
wrong answer 1st lines differ - expected: '453', found: '1362'