为啥全部TLE啊,样例都输出不了
查看原帖
为啥全部TLE啊,样例都输出不了
906545
Apple3楼主2024/3/10 15:35
#include <bits/stdc++.h>
using namespace std;


int main()
{   
	int n;cin>>n;
	int ans=0;
	for(int i=1;i<=n;i++){
		int t=i;
		while(i){
			int y=i%10;
			if(y==2||y==1||y==0||y==9){
				ans+=t;
				break;
			}
			i/=10;
		}
	}
	cout<<ans;
	return 0;
}
2024/3/10 15:35
加载中...