Submission #781776

# Submission time Handle Problem Language Result Execution time Memory
781776 2023-07-13T10:47:02 Z devariaota Strange Device (APIO19_strange_device) C++17
0 / 100
222 ms 15848 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define endl "\n"
#define pii pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define pque priority_queue
#define pqueg priority_queue<ll,vector<ll>,greater<ll>>
#define que queue<ll>
#define FOR(m,i,n) for(int i=(m); i<=(n); i++)
#define FORM(m,i,n) for(int i=(m); i>=(n); i--)
ll n;
ll l[1000100],r[1000100];
ll a,b,ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> a >> b;
  FOR(1,i,n) {
    cin >> l[i] >> r[i];
  }
  if(n == 1) {
    ll y = min(b,r[1]-l[1]+1);
    ll x = min(a,(r[1]-l[1]+1)/b);
    cout << max(x,y) << endl;
  }
//  else if(b == 1) {
//    FOR(1,i,n) {
//      aa = l[i]*2;
//      if(a % 2 == 1) {
//        bb = min(r[i]-l[i]+1,a);
//        if()
//      }
//      else {
//        bb = min((r[i]-l[i]+1)/2),a/2);
//      }
//    }
//    if(a%2 == 0) {
//      cout << (range.se - range.fi) / 2 << endl;
//    }
//    else {
//      cout << range.se - range.fi + 1 << endl;
//    }
//    cout << ans << endl;
//  }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 3 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 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 Incorrect 222 ms 15848 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 222 ms 15848 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 222 ms 15848 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 28 ms 1804 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 3 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -