結果

問題 No.11 カードマッチ
ユーザー jjjj
提出日時 2016-10-01 23:27:28
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 8 ms / 5,000 ms
コード長 510 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 27,488 KB
実行使用メモリ 10,412 KB
最終ジャッジ日時 2023-08-13 16:41:52
合計ジャッジ時間 1,444 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 5 ms
5,928 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 8 ms
10,412 KB
testcase_07 AC 3 ms
5,236 KB
testcase_08 AC 6 ms
6,604 KB
testcase_09 AC 7 ms
10,360 KB
testcase_10 AC 7 ms
8,860 KB
testcase_11 AC 5 ms
8,252 KB
testcase_12 AC 6 ms
8,460 KB
testcase_13 AC 6 ms
7,960 KB
testcase_14 AC 4 ms
5,572 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  type card
     integer::S,K
  end type card
  integer::W,H,N,i,markmatch,numbermatch
  integer,allocatable::mark(:),number(:)
  type(card),allocatable::cards(:)
  read *,W,H,N
  allocate(mark(W),number(H),cards(N))
  mark   = 0
  number = 0
  read *, cards
  do i=1,N
     mark(cards(i)%S) = 1
     number(cards(i)%K) = 1
  end do
  markmatch = COUNT(mark.eq.1)
  numbermatch = COUNT(number.eq.1)
  print '(i0)',markmatch*H+numbermatch*W-markmatch*numbermatch-N

end program main
0