Submission #781531

# Submission time Handle Problem Language Result Execution time Memory
781531 2023-07-13T07:41:56 Z andecaandeci Strange Device (APIO19_strange_device) C++17
0 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define keish                             ios_base::sync_with_stdio(0);       cin.tie(0); cout.tie(0)
      
using namespace std;

int n, a, b, l, r;

signed main(){
      keish;
  cin >> n >> a >> b;
      // if(n == 1){
      //       set<pair<int, int>> s;
      //       for(int i = 0; i < n; i++){
      //             cin >> l >> r;
      //             for(int t = l; t <= r; t++){
      //                   s.insert({(t + t / b) % a, t % b});
      //             }
      //       }
      //       cout << s.size() << '\n';
      // }else if(b == 1){
            set<int> s;
            for(int i = 0; i < n; i++){
                  cin >> l >> r;
                  for(int t = l; t <= r; t++){
                        s.insert((2 * t) % a);
                  }
            }
            cout << s.size() << '\n';
      // }
}     
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 8 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5065 ms 212 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 Incorrect 23 ms 836 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 416 ms 47256 KB Output is correct
3 Runtime error 1763 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 416 ms 47256 KB Output is correct
3 Runtime error 1763 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 416 ms 47256 KB Output is correct
3 Runtime error 1763 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 777 ms 1560 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 8 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -