Submission #781788

# Submission time Handle Problem Language Result Execution time Memory
781788 2023-07-13T10:55:07 Z kebine Strange Device (APIO19_strange_device) C++17
0 / 100
5000 ms 524288 KB
#include<bits/stdc++.h>
 
using namespace std;
 
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long, long long>

long long n,a,b;
set<pll> st;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int tc,i,j;
    cin>>n>>a>>b;
    for(i=1;i<=n;i++)
    {
        long long l,r,x,y;
        cin>>l>>r;
        for(j=l;j<=r;j++)
        {
            x = ((j+(j/b))%a), y = j%b;
            st.insert({x,y});
        }
    }
    cout<<(long long)st.size()<<'\n';
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:16:9: warning: unused variable 'tc' [-Wunused-variable]
   16 |     int tc,i,j;
      |         ^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5097 ms 405040 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 2399 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5069 ms 60520 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5075 ms 77572 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5075 ms 77572 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5075 ms 77572 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1132 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5097 ms 405040 KB Time limit exceeded
3 Halted 0 ms 0 KB -