WA 40 求调
查看原帖
WA 40 求调
1053866
违规用户名1053866楼主2024/11/20 20:33

rt.蒟蒻似乎不止一次卡在红题上

#include<bits/stdc++.h>
using namespace std;
int uid1053866,kkksc03,chen_zhe;
bool atcoder(int codeforces){
	if(codeforces<2)
		return false;
	if(codeforces==2)
		return true;
	for(int pinkrabbit=2;pinkrabbit*pinkrabbit<=codeforces;pinkrabbit++){
		if(codeforces%pinkrabbit==0)
			return false;
	}
	return true;
}
int main(){
	cin>>kkksc03>>chen_zhe;
	for(int luogu=kkksc03;luogu<=chen_zhe;luogu++){
		if(atcoder(luogu))
			uid1053866++;
	}
	cout<<uid1053866;
}
2024/11/20 20:33
加载中...