Submission #781620

# Submission time Handle Problem Language Result Execution time Memory
781620 2023-07-13T08:42:44 Z makanhulia Strange Device (APIO19_strange_device) C++17
0 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

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

int main(){
  cin >> n >> a >> b;
  for (int i = 0; i < n; ++i)
  {
    ll l, r;
    cin >> l >> r;
    for (int i = l; i <= r; ++i)
    {
      pll hasil = {(i + i/b) % a, i % b};
      ll lseb = st.size();
      st.insert(hasil);
    }
  }

  cout << st.size() << "\n";
  return 0;
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:18:10: warning: unused variable 'lseb' [-Wunused-variable]
   18 |       ll lseb = st.size();
      |          ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5081 ms 405052 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 1625 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Execution timed out 5052 ms 60528 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 5085 ms 77552 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 5085 ms 77552 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 5085 ms 77552 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 1284 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 5081 ms 405052 KB Time limit exceeded
3 Halted 0 ms 0 KB -