Submission #781620

#TimeUsernameProblemLanguageResultExecution timeMemory
781620makanhuliaStrange Device (APIO19_strange_device)C++17
0 / 100
5085 ms524288 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...