求助,20分,错的全是WA
查看原帖
求助,20分,错的全是WA
619007
already_dead楼主2024/7/15 20:21
#include<iostream>
#include<cstring>
#include<algorithm>
#include<map>
#include<cmath>
using namespace std;
long long n,d,q;
long long a,b,c;
struct S {
	long long a,b;
	bool operator<(const S& t)const {
		return b>t.b;
	}
}aa;
map<S,long long>m;
int main() {
	scanf("%lld%lld",&n,&q);
	for(long long i=0; i<q; i++) {
		scanf("%lld",&d);
		if(d==2) {
			scanf("%lld %lld",&a,&b);
			aa={a,b};
			printf("%lld\n",m[aa]);
		} else {
			scanf("%lld %lld %lld",&a,&b,&c);
			aa={a,b};
			m[aa]=c;
		}
	}
	return 0;
}
2024/7/15 20:21
加载中...