QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#95733 | #5602. Sun and Moon | Username# | WA | 2ms | 3512kb | C++20 | 1.4kb | 2023-04-11 18:42:12 | 2023-04-11 18:42:14 |
Judging History
answer
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ElGed_Sevawy ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define ld long double
#define el '\n'
#define pi acos(-1)
#define F first
#define S second
#define sz(x) (int)(x).size()
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
ll rand(ll l, ll r){
return uniform_int_distribution<ll>(l, r)(gen);
}
const ll N = 1e6 + 5, M = 1e6 + 5, MOD1 = 1e9 + 7, MOD2 = 1e9 + 9, K = 21, INF = 2e18 + 5, P1 = 29, P2 = 31;
void go() {
int ds, ys, dm, ym;
cin >> ds >> ys >> dm >> ym;
set<ll> v1, v2;
v1.insert(ys - ds);
v2.insert(dm - ym);
while (*v1.rbegin() < 5000) v1.insert(*v1.rbegin() + ys);
while (*v2.rbegin() < 5000){
if(v1.count(*v2.rbegin())){
cout << *v2.rbegin() << el;
return;
}
v2.insert(*v2.rbegin() + ym);
}
}
int32_t main() {
ElGed_Sevawy
int tc = 1;
//cin >> tc;
while (tc--)
go();
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3512kb
input:
3 10 1 2
output:
7
result:
ok single line: '7'
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3448kb
input:
27 32 39 41
output:
613
result:
wrong answer 1st lines differ - expected: '453', found: '613'