村夫 @ 2020-03-09 11:00:38
#include<bits/stdc++.h>
using namespace std;
long long m,a,b,c,t,u;
int main(){
cin>>m;
switch(m){
case 1:cout<<-1;return 0;
case 2:cout<<-1;return 0;
case 5:cout<<-1;return 0;
default:
t=m%14;
a+=(m-t)/14;
b+=(m-t)/14;
c+=(m-t)/14;
switch(t){
case 1:a=a-1;b=b+2;break;
case 2:a=a-1;c=c+3;break;
case 3:c=c+1;break;
case 4:b=b+1;break;
case 5:a=a-1;c=c+4;break;
case 6:c=c+2;break;
case 7:b=b+1;c=c+1;break;
case 8:b=b+2;break;
case 9:c=c+3;break;
case 10:b=b+1;c=c+2;break;
case 11:b=b+2;c=c+1;break;
case 12:c=c+4;break;
case 13:b=b+1;c=c+3;break;
}
}
if(m-a*7-b*4-c*3!=0)
cout<<-1;
else
cout<<a<<" "<<b<<" "<<c;
return 0;
}
by 村夫 @ 2020-03-09 11:01:35
鬼畜代码更新
by YUYGFGG @ 2020-03-09 11:02:13
???
by Suuon_Kanderu @ 2020-03-09 11:02:38
看不懂
by pocafup @ 2020-03-09 11:04:00
这种代码目测不可能有人调,建议下次要么加comment要么建function写?这样没人看得懂的
by memsetst @ 2020-03-09 11:04:21
而且
if(m-a*7-b*4-c*3!=0)
cout<<-1;
没必要
by memsetst @ 2020-03-09 11:04:48
懒得调
by 村夫 @ 2020-03-09 11:05:47
@pocafup 老师没交comment和function
by pocafup @ 2020-03-09 11:07:02
@村夫 comment是指
by memsetst @ 2020-03-09 11:07:03
话说if它不香吗
by pocafup @ 2020-03-09 11:07:14
@村夫 comment是指