Submission #27856072


Source Code Expand

#include <iostream>
using namespace std;

long long N, A, B, P, Q, R, S;

char f(long long i, long long j) {
  long long ka = i - A, kb = j - B;

  long long kmin = max(1LL-A, 1LL-B), kmax = min(N-A, N-B);
  if (kmin <= ka && ka <= kmax && kmin <= kb && kb <= kmax && ka == kb) { return '#'; }

  kmin = max(1LL-A, B-N), kmax = min(N-A, B-1LL);
  if (kmin <= ka && ka <= kmax && kmin <= -kb && -kb <= kmax && ka == -kb) { return '#'; }
  return '.';
}

int main() {
  cin >> N >> A >> B;
  cin >> P >> Q >> R >> S;

  for (long long i = P; i <= Q; i++) {
    for (long long j = R; j <= S; j++) {
      putchar(f(i, j));
    }
    puts("");
  }
}

Submission Info

Submission Time
Task C - X drawing
User daimatz
Language C++ (GCC 9.2.1)
Score 300
Code Size 673 Byte
Status AC
Exec Time 15 ms
Memory 3560 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 35
Set Name Test Cases
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
Case Name Status Exec Time Memory
example_00.txt AC 9 ms 3480 KiB
example_01.txt AC 2 ms 3508 KiB
example_02.txt AC 2 ms 3392 KiB
hand_00.txt AC 4 ms 3508 KiB
hand_01.txt AC 7 ms 3496 KiB
hand_02.txt AC 15 ms 3560 KiB
hand_03.txt AC 9 ms 3556 KiB
hand_04.txt AC 5 ms 3336 KiB
hand_05.txt AC 2 ms 3504 KiB
hand_06.txt AC 4 ms 3556 KiB
hand_07.txt AC 7 ms 3496 KiB
hand_08.txt AC 5 ms 3476 KiB
hand_09.txt AC 5 ms 3504 KiB
hand_10.txt AC 5 ms 3480 KiB
hand_11.txt AC 7 ms 3476 KiB
random_00.txt AC 5 ms 3504 KiB
random_01.txt AC 4 ms 3452 KiB
random_02.txt AC 8 ms 3336 KiB
random_03.txt AC 6 ms 3400 KiB
random_04.txt AC 4 ms 3400 KiB
random_05.txt AC 3 ms 3500 KiB
random_06.txt AC 10 ms 3364 KiB
random_07.txt AC 4 ms 3480 KiB
random_08.txt AC 7 ms 3392 KiB
random_09.txt AC 5 ms 3364 KiB
random_10.txt AC 6 ms 3456 KiB
random_11.txt AC 4 ms 3520 KiB
random_12.txt AC 5 ms 3496 KiB
random_13.txt AC 3 ms 3508 KiB
random_14.txt AC 7 ms 3560 KiB
random_15.txt AC 3 ms 3508 KiB
random_16.txt AC 4 ms 3504 KiB
random_17.txt AC 4 ms 3388 KiB
random_18.txt AC 7 ms 3400 KiB
random_19.txt AC 2 ms 3360 KiB