为什么#1RE?本地可过。
查看原帖
为什么#1RE?本地可过。
640552
spacebar楼主2022/7/14 14:14
#include <bits/stdc++.h>
using namespace std;
bool l[20004]{0};
int main(){
	l[1]=1;
	for(long long g=2;g<20004;g++){
		if(l[g]==1){
			continue;
		}
		for(int h=2;g*h<20004;h++){
			l[g*h]=1;
		}
	}
	int h;
	cin>>h;
	for(int z=2;z<114514;z++)
		for(int zz=2;zz<20001;zz++){
			if(l[z]==0&&l[zz]==0&&l[h-z-zz]==0&&(h-z-zz>=1)){
				cout<<z<<" "<<zz<<" "<<h-z-zz;
				return 0;
			}
		}
	return 0;
}

#1过不去

in 999

out 3 5 991

2022/7/14 14:14
加载中...