QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#461136 | #8488. Squares | Lynkcat# | WA | 1ms | 3660kb | C++14 | 1.3kb | 2024-07-02 16:19:27 | 2024-07-02 16:19:27 |
Judging History
answer
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
// #define int ll
// #define N
using namespace std;
int n,f[2][2],g[4][4];
map<pa,int>Mp;
void ers(int x,int y)
{
Mp.erase({x,y});
f[x%2][y%2]--;
g[x%4][y%4]--;
}
void ins(int x,int y)
{
Mp[{x,y}]=1;
f[x%2][y%2]++;
g[x%4][y%4]++;
}
void BellaKira()
{
cin>>n;
for (int i=1;i<=n;i++)
{
int x,y;
cin>>x>>y;
// cerr<<"wtf"<<endl;
if (Mp.count({x,y})) ers(x,y);
else ins(x,y);
// cerr<<"wtf"<<endl;
int ans=0;
for (int i=0;i<2;i++)
for (int j=0;j<2;j++) ans=max(ans,f[i][j]);
for (int i=0;i<4;i++)
for (int j=0;j<4;j++)
ans=max(ans,g[i][j]+g[(i+2)%4][j]+g[(i+1)%4][(j+2)%4]+g[(i+3)%4][(j+2)%4]);
for (int i=0;i<4;i++)
for (int j=0;j<4;j++)
ans=max(ans,g[i][j]+g[(i+2)%4][(j+1)%4]+g[i][(j+2)%4]+g[(i+2)%4][(j+3)%4]);
cout<<ans<<'\n';
}
}
signed main()
{
IOS;
cin.tie(0);
int T=1;
while (T--)
{
BellaKira();
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3612kb
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: 0
Accepted
time: 0ms
memory: 3660kb
input:
6 1000000000 1000000000 1 1 2 1 3 1 2 1 1 1
output:
1 1 2 2 2 1
result:
ok 6 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
1 1 1
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
5 564718673 358502890 690430685 632939232 585325539 365329221 564718673 358502890 412106895 291882089
output:
1 2 3 2 3
result:
ok 5 number(s): "1 2 3 2 3"
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3624kb
input:
20 509061481 552472140 764514676 914746017 509061481 552472140 862937826 103626886 387546138 832279893 759454419 427833657 473906880 203664913 677780684 519361360 473906880 203664913 954478790 346543678 694729965 875591136 16115810 148658854 13062847 965187713 387546138 832279893 862937826 103626886...
output:
1 1 1 2 2 2 3 3 2 3 3 4 4 4 3 4 4 5 5 4
result:
wrong answer 5th numbers differ - expected: '3', found: '2'