QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#478527#8488. Squaresrania__#WA 0ms3584kbC++231.1kb2024-07-15 04:14:182024-07-15 04:14:19

Judging History

你现在查看的是最新测评结果

  • [2024-07-15 04:14:19]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2024-07-15 04:14:18]
  • 提交

answer

#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef int in;
#define int long long
#define double long double
#define f first
#define s second
#define pb push_back
#define pp push
#define ceill(x,y) ((x/y)+(x%y!=0)*(x/abs(x)*y/abs(y)<0?0:1))
#define floorr(x,y) ((x/y)+(x%y!=0)*(x/abs(x)*y/abs(y)<0?-1:0))
#define YN(x) cout<<(x?"YES\n":"NO\n");
#define Yn(x) cout<<(x?"Yes\n":"No\n");
#define yn(x) cout<<(x?"yes\n":"no\n");
const int MAAX=1e18;
const int MOD=1e9+7;
const int MAX=1e9;

map<pair<int,int>,int> mp;

in main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int tc=1;
    // cin>>tc;
    while(tc--){
		int q;
		cin>>q;
		int a=0,b=0,c=0,d=0;
		while(q--){
			int x,y;
			cin>>x>>y;
			if(mp[{x,y}]){
				if(x%2&&y%2)
					a--;
				else if(x%2&&y%2==0)
					b--;
				else if(x%2==0&&y%2)
					c--;
				else
					d--;
			}
			else{
				if(x%2&&y%2)
					a++;
				else if(x%2&&y%2==0)
					b++;
				else if(x%2==0&&y%2)
					c++;
				else
					d++;
			}
			mp[{x,y}]=!mp[{x,y}];
			cout<<max(max(a,b),max(c,d))<<"\n";
		}
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3576kb

input:

5
1 1
2 2
3 3
4 4
1 1

output:

1
1
2
2
2

result:

ok 5 number(s): "1 1 2 2 2"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3584kb

input:

6
1000000000 1000000000
1 1
2 1
3 1
2 1
1 1

output:

1
1
1
2
2
1

result:

wrong answer 3rd numbers differ - expected: '2', found: '1'