QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#643713 | #7962. 前缀和 | hos_lyric# | AC ✓ | 1ms | 3964kb | C++14 | 1.4kb | 2024-10-15 23:18:18 | 2024-10-15 23:18:19 |
Judging History
answer
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
int main() {
Int N, L, R;
long double P;
for (; ~scanf("%lld%Lf%lld%lld", &N, &P, &L, &R); ) {
const long double ans = P * (R - L + 1);
printf("%.12Lf\n", ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3964kb
input:
3 0.5 1 2
output:
1.000000000000
result:
ok found '1.0000000', expected '1.0000000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
1 0.529148 1 1
output:
0.529148000000
result:
ok found '0.5291480', expected '0.5291480', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
1000000000 0.592692 495948205 808386938
output:
185179938.131927999988
result:
ok found '185179938.1319280', expected '185179938.1320000', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
362633210 0.587463 165288121 324679823
output:
93636728.019488999998
result:
ok found '93636728.0194890', expected '93636728.0195000', error '0.0000000'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
763961137 0.360268 233953864 630625466
output:
142908085.069604000004
result:
ok found '142908085.0696040', expected '142908085.0700000', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
1000000000 0.999999 1 1000000000
output:
999999000.000000000000
result:
ok found '999999000.0000000', expected '999999000.0000000', error '0.0000000'