- 「一本通 6.4 例 1」青蛙的约会
1
- @ 2025-11-9 11:40:52
#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int x, y, m, n, l;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>x>>y>>m>>n>>l;
if(x>y){
swap(x,y);
swap(m,n);
}
if(m>=n){
int h = (y-x)/(m-n);
if(h*(m-n) == y-x){
cout<<h;
return 0;
}
}
if(n>m){
int h = (l-y+x)/(n-m);
if(h*(n-m) == l-y+x){
cout<<h;
return 0;
}
}
cout<<"Impossible";
return 0;
}
为什么用路程差除以速度差只有60分
0 条评论
目前还没有评论...
信息
- ID
- 2345
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 4
- 标签
- 递交数
- 30
- 已通过
- 16
- 上传者