提出 #27973477


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main(){
    long long n, a, b, p, q, r, s;
    cin >> n >> a >> b >> p >> q >> r >> s;
    //Adjust to 1-indexing. 
    vector<vector<char>> arr (q-p+1, vector<char>(s-r+1, '.'));
    for (long long k=max(max(p-a, r-b), max(1-a, 1-b));k<=min(min(q-a, s-b), min(n-a,n-b));k++){
        arr[a+k-p][b+k-r] = '#';
    }
    for (long long k=max(max(p-a, b-s), max(1-a, b-n));k<=min(min(b-r, q-a), min(n-a, b-1));k++){
        arr[a+k-p][b-k-r] = '#';
    }
    for (long long i=0;i<=q-p;i++){
        for (long long j=0;j<=s-r;j++){
            cout << arr[i][j];
        }
        cout << endl;
    }
}

提出情報

提出日時
問題 C - X drawing
ユーザ suguruchhaya
言語 C++ (GCC 9.2.1)
得点 300
コード長 670 Byte
結果 AC
実行時間 449 ms
メモリ 19376 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 35
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 9 ms 3512 KiB
example_01.txt AC 3 ms 3384 KiB
example_02.txt AC 2 ms 3456 KiB
hand_00.txt AC 13 ms 3712 KiB
hand_01.txt AC 16 ms 3652 KiB
hand_02.txt AC 449 ms 19376 KiB
hand_03.txt AC 11 ms 3528 KiB
hand_04.txt AC 15 ms 3652 KiB
hand_05.txt AC 3 ms 3544 KiB
hand_06.txt AC 6 ms 3668 KiB
hand_07.txt AC 13 ms 3748 KiB
hand_08.txt AC 8 ms 3504 KiB
hand_09.txt AC 11 ms 3780 KiB
hand_10.txt AC 18 ms 3856 KiB
hand_11.txt AC 15 ms 3536 KiB
random_00.txt AC 14 ms 3820 KiB
random_01.txt AC 15 ms 3636 KiB
random_02.txt AC 11 ms 3640 KiB
random_03.txt AC 26 ms 3760 KiB
random_04.txt AC 17 ms 3776 KiB
random_05.txt AC 11 ms 3576 KiB
random_06.txt AC 11 ms 3708 KiB
random_07.txt AC 11 ms 3696 KiB
random_08.txt AC 9 ms 3752 KiB
random_09.txt AC 13 ms 3708 KiB
random_10.txt AC 13 ms 3796 KiB
random_11.txt AC 8 ms 3648 KiB
random_12.txt AC 24 ms 3772 KiB
random_13.txt AC 27 ms 3612 KiB
random_14.txt AC 19 ms 3752 KiB
random_15.txt AC 21 ms 3812 KiB
random_16.txt AC 21 ms 3760 KiB
random_17.txt AC 17 ms 3872 KiB
random_18.txt AC 35 ms 3708 KiB
random_19.txt AC 17 ms 3628 KiB