QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#95733#5602. Sun and MoonUsername#WA 2ms3512kbC++201.4kb2023-04-11 18:42:122023-04-11 18:42:14

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-11 18:42:14]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3512kb
  • [2023-04-11 18:42:12]
  • 提交

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'