12255 - Underwater Snipers

All about problems in Volume 122. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

12255 - Underwater Snipers

Post by brianfry713 » Fri Sep 12, 2014 12:19 am

Use this thread to discuss this problem.
Check input and AC output for thousands of problems on uDebug!

metaphysis
Experienced poster
Posts: 138
Joined: Wed May 18, 2011 3:04 pm

Re: 12255 - Underwater Snipers

Post by metaphysis » Tue Dec 18, 2018 2:12 pm

Test data generator.

Code: Select all

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
    srand(time(NULL));

    int T = 100;
    cout << T << "\n\n";
    for (int cs = 1; cs <= T; cs++)
    {
        long long k, N, S, D, x, y;
        k = rand() % 100000000;
        if (rand() % 100 > 70) k *= -1;
        N = rand() % 1000 + 1;
        S = rand() % 1000 + 1;
        D = rand() % 1000000000 + 1;
        cout << k << ' ' << N << ' ' << S << ' ' << D << '\n';
        for (int i = 0; i < N; i++)
        {
            x = rand() % 100000000;
            if (rand() % 100 > 70) x *= -1;
            y = k + rand() % (100000000LL - k);
            cout << x << ' ' << y << '\n';
        }
        cout << '\n';
    }

    return 0;
}

Post Reply

Return to “Volume 122 (12200-12299)”