蜜汁 UKE……
  • 板块CF44B Cola
  • 楼主TRZ_2007
  • 当前回复1
  • 已保存回复1
  • 发布时间2020/10/25 15:00
  • 上次更新2023/11/5 09:55:11
查看原帖
蜜汁 UKE……
86971
TRZ_2007楼主2020/10/25 15:00

人傻了……

#include <bits/stdc++.h>
using namespace std;

long long n,a,b,c,ans;
long long x,y;

int main() {
	scanf("%lld %lld %lld %lld",&n,&x,&y,&c);
	b = x / 2 + y;
	for(long long i = 0;i <= b;i++) {
		for(long long j = 0;j <= c;j++) {
			if(i + j * 2 == n) {
				if(j * 2 == n) {
					++ans;
					continue;
				}
				if(max(x / 2,y) >= i) ans += min(i + 1,min(x / 2,y) + 1);
				else ans += min(x / 2,y) - (i - max(x / 2,y)) + 1;
			}
		}
	}
	printf("%lld\n",ans);
	return 0;
}
2020/10/25 15:00
加载中...