提出 #21303846


ソースコード 拡げる

#include <stdio.h>

int main () {
  int h = 0;
  int w = 0;
  int x = 0;
  int y = 0;
  char s[100][101] = {};
  
  int res = 0;

  int ans = 1;
  int i = 1;
  
  res = scanf("%d", &h);
  res = scanf("%d", &w);
  res = scanf("%d", &x);
  res = scanf("%d", &y);

  for (int j = 0; j < h; j++) {
    res = scanf("%s",s[j]);
  }
  
  while (y-i > 0 && s[x-1][y-i-1] == '.') {
    ans++;
    i++;
  }
  
  i=1;
  
  while (y+i <= w && s[x-1][y+i-1] == '.') {
    ans++;
    i++;
  }
  
  i=1;
  
  while (x-i > 0 && s[x-i-1][y-1] == '.') {
    ans++;
    i++;
  }
  
  i=1;
  
  while (x+i <= h && s[x+i-1][y-1] == '.') {
    ans++;
    i++;
  }
  
  printf("%d\n",ans);
  
  return 0;
}

提出情報

提出日時
問題 B - Visibility
ユーザ chro4896
言語 C (GCC 9.2.1)
得点 200
コード長 735 Byte
結果 AC
実行時間 5 ms
メモリ 1744 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 32
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All extreme_00.txt, extreme_01.txt, extreme_02.txt, extreme_03.txt, extreme_04.txt, extreme_05.txt, extreme_06.txt, extreme_07.txt, handmade_00.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, sample_01.txt, sample_02.txt, sample_03.txt
ケース名 結果 実行時間 メモリ
extreme_00.txt AC 5 ms 1684 KiB
extreme_01.txt AC 1 ms 1664 KiB
extreme_02.txt AC 1 ms 1720 KiB
extreme_03.txt AC 1 ms 1648 KiB
extreme_04.txt AC 1 ms 1652 KiB
extreme_05.txt AC 1 ms 1688 KiB
extreme_06.txt AC 1 ms 1664 KiB
extreme_07.txt AC 2 ms 1668 KiB
handmade_00.txt AC 1 ms 1696 KiB
random_00.txt AC 1 ms 1740 KiB
random_01.txt AC 2 ms 1652 KiB
random_02.txt AC 1 ms 1660 KiB
random_03.txt AC 1 ms 1660 KiB
random_04.txt AC 1 ms 1664 KiB
random_05.txt AC 1 ms 1736 KiB
random_06.txt AC 1 ms 1744 KiB
random_07.txt AC 1 ms 1716 KiB
random_08.txt AC 1 ms 1696 KiB
random_09.txt AC 1 ms 1660 KiB
random_10.txt AC 1 ms 1660 KiB
random_11.txt AC 1 ms 1664 KiB
random_12.txt AC 1 ms 1688 KiB
random_13.txt AC 1 ms 1736 KiB
random_14.txt AC 2 ms 1744 KiB
random_15.txt AC 1 ms 1692 KiB
random_16.txt AC 3 ms 1684 KiB
random_17.txt AC 2 ms 1736 KiB
random_18.txt AC 1 ms 1688 KiB
random_19.txt AC 3 ms 1664 KiB
sample_01.txt AC 1 ms 1684 KiB
sample_02.txt AC 1 ms 1640 KiB
sample_03.txt AC 1 ms 1660 KiB