Submission #440344

# Submission time Handle Problem Language Result Execution time Memory
440344 2021-07-02T06:52:45 Z VladM Strange Device (APIO19_strange_device) C++14
10 / 100
5000 ms 524292 KB
#include <bits/stdc++.h>

using namespace std;

#define DIM 1000007

typedef pair<long long, long long> pll;

long long n, A, B, l[DIM], r[DIM];

set<pll> s;

int main()
{
    cin>>n>>A>>B;
    for(int i=1; i<=n; i++)
    {
        cin>>l[i]>>r[i];
    }
    for(int i=1; i<=n; i++)
    {
        for(long long t=l[i]; t<=r[i]; t++)
        {
            s.insert({(t+t/B)%A, t%B});
            if(s.size()==A*B) break;
        }
    }
    cout<<s.size();
    return 0;
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:25:24: warning: comparison of integer expressions of different signedness: 'std::set<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   25 |             if(s.size()==A*B) break;
      |                ~~~~~~~~^~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 80 ms 12368 KB Output is correct
3 Correct 93 ms 17988 KB Output is correct
4 Correct 2 ms 844 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 9 ms 1100 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 43 ms 6940 KB Output is correct
16 Correct 43 ms 6852 KB Output is correct
17 Correct 165 ms 8136 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 2558 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 158 ms 32224 KB Output is correct
3 Correct 206 ms 32060 KB Output is correct
4 Correct 134 ms 30512 KB Output is correct
5 Execution timed out 5064 ms 103232 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1656 ms 78556 KB Output is correct
3 Runtime error 3618 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1656 ms 78556 KB Output is correct
3 Runtime error 3618 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1656 ms 78556 KB Output is correct
3 Runtime error 3618 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 1847 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 80 ms 12368 KB Output is correct
3 Correct 93 ms 17988 KB Output is correct
4 Correct 2 ms 844 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 9 ms 1100 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 43 ms 6940 KB Output is correct
16 Correct 43 ms 6852 KB Output is correct
17 Correct 165 ms 8136 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Runtime error 2558 ms 524292 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -