QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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();
}
}
詳細信息
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'