QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#639607 | #7781. Sheep Eat Wolves | HSTKwow | WA | 0ms | 3720kb | C++14 | 542b | 2024-10-13 20:46:31 | 2024-10-13 20:46:32 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
typedef long double ld;
typedef pair<int,int> pii;
const int N = 2e5+10;
signed main(){
IOS;
int x,y,p,q;
cin>>x>>y>>p>>q;
if(x+p+q<y){
cout<<-1<<endl;
}else{
int pcnt=(p+q)/2;
if(!pcnt){
cout<<x<<endl;
return 0;
}
int ans=x/pcnt;
ans=ans*2-1;
cout<<ans<<endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3720kb
input:
4 4 3 1
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
3 5 2 0
output:
5
result:
ok 1 number(s): "5"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2 5 1 1
output:
-1
result:
ok 1 number(s): "-1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1 1 1 0
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3560kb
input:
3 3 1 1
output:
5
result:
wrong answer 1st numbers differ - expected: '7', found: '5'