4 条题解
-
5冯宥然 (youran) LV 8 @ 2022-1-23 14:00:06
#include <iostream> using namespace std; int main(){ int n,m,num; cin>>n>>m; num=n; n*=4; if(m>n||(n-m)%2==1||((n-m)/2)>num){ cout<<"No answer"<<endl; return 0; } m=(n-m)/2; cout<<m<<" "<<num-m<<endl; return 0; }
-
02023-11-7 17:24:27@
#include <iostream> using namespace std; int main(){ int n,m,num; cin>>n>>m; num=n; n*=4; if(m>n||(n-m)%2==1||((n-m)/2)>num){ cout<<"No answer"<<endl; return 0; } m=(n-m)/2; cout<<m<<" "<<num-m<<endl; return 0; }
-
02021-10-15 13:12:10@
n,m=input().split()
a=round((int(m)-int(n)*2)/(4-2))
if int(n)-a <0 or a<0:
print('No answer')
elif int(m)<int(n) or int(m)%2==1:
print('No answer')
else:
print(int(n)- a,a)
-
02021-10-14 21:01:35@
n,m=input().split() a=round((int(m)-int(n)*2)/(4-2)) if int(n)-a <0 or a<0: print('No answer') elif int(m)<int(n) or int(m)%2==1: print('No answer') else: print(int(n)- a,a)
- 1
信息
- ID
- 858
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 8
- 标签
- 递交数
- 673
- 已通过
- 106
- 上传者