Submission #71660915


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
const int maxn=105;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n,m;
    cin>>n>>m;
    int ans=0;
    set<pair<int,int>> s;
    while (m--)
    {
        int r,c;
        cin>>r>>c;
        for (int i=0;i<2;i++)
        {
            for (int j=0;j<2;j++)
            {
                if (s.find({r+i,c+j})!=s.end())
                {
                    goto l;
                }
            }
        }
        ans++;
        for (int i=0;i<2;i++)
            for (int j=0;j<2;j++)
                s.insert({r+i,j+c});
        l:;
    }
    cout<<ans;
}

Submission Info

Submission Time
Task C - 2x2 Placing
User Alliy666
Language C++23 (GCC 15.2.0)
Score 300
Code Size 691 Byte
Status AC
Exec Time 315 ms
Memory 41092 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 36
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 02_random2_09.txt, 02_random2_10.txt, 02_random2_11.txt, 02_random2_12.txt, 02_random2_13.txt, 02_random2_14.txt, 02_random2_15.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3528 KiB
00_sample_01.txt AC 1 ms 3396 KiB
00_sample_02.txt AC 1 ms 3540 KiB
01_random_00.txt AC 6 ms 3588 KiB
01_random_01.txt AC 10 ms 3588 KiB
01_random_02.txt AC 13 ms 3404 KiB
01_random_03.txt AC 28 ms 3744 KiB
01_random_04.txt AC 56 ms 11040 KiB
01_random_05.txt AC 44 ms 4612 KiB
01_random_06.txt AC 169 ms 24608 KiB
01_random_07.txt AC 310 ms 39328 KiB
01_random_08.txt AC 167 ms 22744 KiB
01_random_09.txt AC 315 ms 40964 KiB
01_random_10.txt AC 45 ms 11412 KiB
01_random_11.txt AC 267 ms 41048 KiB
02_random2_00.txt AC 267 ms 41092 KiB
02_random2_01.txt AC 269 ms 40916 KiB
02_random2_02.txt AC 262 ms 40488 KiB
02_random2_03.txt AC 260 ms 40324 KiB
02_random2_04.txt AC 259 ms 39968 KiB
02_random2_05.txt AC 256 ms 39512 KiB
02_random2_06.txt AC 251 ms 38816 KiB
02_random2_07.txt AC 249 ms 37932 KiB
02_random2_08.txt AC 247 ms 36868 KiB
02_random2_09.txt AC 241 ms 35360 KiB
02_random2_10.txt AC 227 ms 33044 KiB
02_random2_11.txt AC 214 ms 30296 KiB
02_random2_12.txt AC 182 ms 25816 KiB
02_random2_13.txt AC 147 ms 20476 KiB
02_random2_14.txt AC 96 ms 13020 KiB
02_random2_15.txt AC 30 ms 3872 KiB
03_handmade_00.txt AC 10 ms 3604 KiB
03_handmade_01.txt AC 102 ms 22408 KiB
03_handmade_02.txt AC 133 ms 22432 KiB
03_handmade_03.txt AC 101 ms 22420 KiB
03_handmade_04.txt AC 83 ms 16132 KiB