迷惑TLE
查看原帖
迷惑TLE
575302
wsdyz2010楼主2022/4/4 11:18
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9')if(ch=='-')f=-1,ch=getchar();
	while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return x*f;
}
int n,t,num;
int vis[10000005]={0};
unsigned long long ans;
int main(){
	n=read();
	for(int i=1;i<=n;++i){
		num=read();
		t=read();
		if(t<=1)continue;
		else if(vis[num])continue;
		else{
			ans+=t;
			vis[num]=true;
		}
	}
	printf("%lld",ans);
} 
2022/4/4 11:18
加载中...