結果

問題 No.11 カードマッチ
ユーザー jjjj
提出日時 2016-10-01 23:27:28
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 10 ms / 5,000 ms
コード長 510 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 32,864 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-05-01 09:27:39
合計ジャッジ時間 1,234 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 5 ms
5,632 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 9 ms
10,112 KB
testcase_07 AC 4 ms
5,376 KB
testcase_08 AC 6 ms
6,272 KB
testcase_09 AC 10 ms
10,112 KB
testcase_10 AC 7 ms
8,576 KB
testcase_11 AC 7 ms
7,808 KB
testcase_12 AC 8 ms
8,192 KB
testcase_13 AC 6 ms
7,680 KB
testcase_14 AC 4 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 2 ms
5,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