Submission #781643

# Submission time Handle Problem Language Result Execution time Memory
781643 2023-07-13T09:06:47 Z andecaandeci Strange Device (APIO19_strange_device) C++17
0 / 100
177 ms 524288 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
  ll n,a,b;cin>>n>>a>>b;
  bool vis[b][1000000000];
  ll ans=0;
  for(int j=1;j<=n;j++){
    ll x,y;cin>>x>>y;
    for(ll i=x;i<=y;i++){
      ll c=(i+i/b)%a;
      ll d=i%b;
      if(!vis[d][c]){
        ans++;
        vis[d][c]=true;
      }
    }     
  }
  cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Runtime error 177 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 162 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 162 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 161 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 161 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 161 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 152 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 177 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -