QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#762321 | #7962. 前缀和 | gcx12012# | WA | 1ms | 3900kb | C++14 | 901b | 2024-11-19 14:36:53 | 2024-11-19 14:36:56 |
Judging History
answer
#include<bits/stdc++.h>
#include<cmath>
#define ll long long
#define lll __int128
#define ull unsigned long long
#define N 200010
#define For(i,a,b) for(ll i=a;i<=b;++i)
#define Rof(i,a,b) for(ll i=a;i>=b;--i)
#define ls x<<1
#define rs x<<1|1
#define lson ls,l,mid
#define rson rs,mid+1,r
#define pb push_back
#define mk make_pair
#define pque priority_queue
#define pii pair<ll,ll>
using namespace std;
bool st;
ll n,l,r;
double p;
bool ed;
ll read(){
ll x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
int main()
{
//fprintf(stderr,"%.2lf",(double)(&ed-&st)/1024/1024);
//freopen("print.in","r",stdin);
//freopen("print.out","w",stdout);
cin>>n>>p>>l>>r;
p=1/p;
printf("%.8lf",floor((double)r/p)-floor((double)(l-1)/p));
return 0;
}
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3900kb
input:
3 0.5 1 2
output:
1.00000000
result:
ok found '1.0000000', expected '1.0000000', error '0.0000000'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3896kb
input:
1 0.529148 1 1
output:
0.00000000
result:
wrong answer 1st numbers differ - expected: '0.5291480', found: '0.0000000', error = '0.5291480'