UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#212280#3811. T1connectionCompile Error//C++1.2kb2024-10-13 17:23:302024-10-13 19:37:48

answer

// #pragma GCC optimize(1)
// #pragma GCC optimize(2)
// #pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define mod ll(1e9+7)
int t,opt,d,a,b;
struct node{
	int a,b;
};
#define fastin ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
bool operator<(const node &a,const node &b){
	if(a.a!=b.a)return a.a<b.a;
	return a.b<b.b;
}
map<node,int>l,c;
int main(){
	fastin;
	cin>>t;
	while(t--){
		cin>>opt>>d>>a>>b;
		if(opt == 1){
			if(d == 0)l[(node){a,b}]++;
			if(d == 1)c[(node){a,b}]++;
		}else{
			if(d == 0)l[(node){a,b}]--;
			if(d == 1)c[(node){a,b}]--;
		}
		if(l.size() == 0 || c.size() == 0){
			cout<<-1<<endl;
			continue;
		}
		int ans = INT_MAX;
//		for(auto i:l)printf("[(%d,%d),%d]",i.first.a,i.first.b,i.second);cout<<endl;
//		for(auto i:c)printf("[(%d,%d),%d]",i.first.a,i.first.b,i.second);cout<<endl;
		for(auto i:l){
			if(i.second <= 0)continue;
			for(auto j:c){
				if(j.second <= 0)continue;
				int res = max(i.first.a+j.first.a,i.first.b+j.first.b);
				if(ans > res) ans = res;
				else break;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

详细

answer.code: In function 'int main()':
answer.code:40:12: error: 'i' does not name a type
   for(auto i:l){\x0d
            ^
answer.code:49:3: error: expected ';' before 'cout'
   cout<<ans<<endl;\x0d
   ^
answer.code:50:2: error: expected primary-expression before '}' token
  }\x0d
  ^
answer.code:50:2: error: expected ')' before '}' token
answer.code:50:2: error: expected primary-expression before '}' token
answer.code:50:2: error: expected ';' before '}' token