Submission #782160

# Submission time Handle Problem Language Result Execution time Memory
782160 2023-07-13T15:51:42 Z devariaota 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++)
        {
            st.insert({(j+j/b)%a,j%b});
        }
    }
    cout<<(long long)st.size()<<'\n';
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:20:23: warning: unused variable 'x' [-Wunused-variable]
   20 |         long long l,r,x,y;
      |                       ^
strange_device.cpp:20:25: warning: unused variable 'y' [-Wunused-variable]
   20 |         long long l,r,x,y;
      |                         ^
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 5059 ms 405016 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 2005 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 5054 ms 60588 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 5044 ms 77492 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 5044 ms 77492 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 5044 ms 77492 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 1204 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 5059 ms 405016 KB Time limit exceeded
3 Halted 0 ms 0 KB -