提出 #62266040


ソースコード 拡げる

#include <bits/extc++.h>
#define endl '\n'
typedef long long ll;

using namespace std;
using namespace __gnu_pbds;
#define priority_queue std::priority_queue

char nxt(){char b; cin >> b; return b;}

int N, M;
bool S[51][51], T[51][51];

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> N >> M;
    for(int i=0; i<N; i++)
        for(int j=0; j<N; S[i][j++]=(nxt()=='.'));
    for(int i=0; i<M; i++)
        for(int j=0; j<M; T[i][j++]=(nxt()=='.'));
    
    for(int a=0; a<N; a++)
        for(int b=0; b<N; b++)
        {
            bool jo=true;
            for(int i=0; i<M && jo; i++)
                for(int j=0; j<M; j++)
                    jo&=(T[i][j]==S[a+i][b+j]);

            if(jo)
            {
                cout << a+1 << " " << b+1 << endl;
                return 0;
            }
        }
    
    return 0;
}
/*
3 2
#.#
..#
##.
.#
#.

2 1
#.
##
.
*/

提出情報

提出日時
問題 B - Seek Grid
ユーザ pgergo03
言語 C++ 17 (gcc 12.2)
得点 200
コード長 946 Byte
結果 AC
実行時間 2 ms
メモリ 3608 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 26
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.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, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 1 ms 3396 KiB
00_sample_02.txt AC 1 ms 3408 KiB
01_random_01.txt AC 1 ms 3460 KiB
01_random_02.txt AC 1 ms 3536 KiB
01_random_03.txt AC 1 ms 3536 KiB
01_random_04.txt AC 1 ms 3580 KiB
01_random_05.txt AC 1 ms 3408 KiB
01_random_06.txt AC 1 ms 3396 KiB
01_random_07.txt AC 1 ms 3608 KiB
01_random_08.txt AC 1 ms 3452 KiB
01_random_09.txt AC 1 ms 3536 KiB
01_random_10.txt AC 1 ms 3428 KiB
01_random_11.txt AC 1 ms 3344 KiB
01_random_12.txt AC 1 ms 3480 KiB
01_random_13.txt AC 1 ms 3344 KiB
01_random_14.txt AC 1 ms 3468 KiB
01_random_15.txt AC 1 ms 3340 KiB
01_random_16.txt AC 1 ms 3412 KiB
01_random_17.txt AC 1 ms 3340 KiB
01_random_18.txt AC 2 ms 3344 KiB
01_random_19.txt AC 1 ms 3472 KiB
01_random_20.txt AC 1 ms 3536 KiB
02_handmade_01.txt AC 1 ms 3416 KiB
02_handmade_02.txt AC 2 ms 3476 KiB
02_handmade_03.txt AC 1 ms 3340 KiB
02_handmade_04.txt AC 1 ms 3456 KiB