Submission #926311

#TimeUsernameProblemLanguageResultExecution timeMemory
926311TAhmed33Strange Device (APIO19_strange_device)C++98
10 / 100
5032 ms524288 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main () { ll n, a, b; cin >> n >> a >> b; vector <pair <ll, ll>> arr(n); for (auto &[x, y] : arr) cin >> x >> y; set <pair <ll, ll>> xx; for (auto [x, y] : arr) { for (ll i = x; i <= y; i++) { ll g = (i + (i / b)) % a, h = i % b; xx.insert({g, h}); } } cout << (int)xx.size() << '\n'; }

Compilation message (stderr)

strange_device.cpp: In function 'int main()':
strange_device.cpp:6:47: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
    6 |     vector <pair <ll, ll>> arr(n); for (auto &[x, y] : arr) cin >> x >> y;
      |                                               ^
strange_device.cpp:8:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
    8 |     for (auto [x, y] : arr) {
      |               ^
#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...