結果

問題 No.24 数当てゲーム
ユーザー concon
提出日時 2019-06-14 18:29:46
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 519 bytes
コンパイル時間 2,081 ms
コンパイル使用メモリ 27,972 KB
実行使用メモリ 4,512 KB
最終ジャッジ日時 2023-08-07 21:53:47
合計ジャッジ時間 3,114 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,512 KB
testcase_09 AC 1 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

implicit none
integer(8) n,i,j
character a*3
integer(8),allocatable :: x(:,:)
integer(8),allocatable :: y(:)
read(*,*) n
allocate (x(1:n,4))
allocate (y(0:9))
y(0:9)=4
do i=1,n
   read(*,*) (x(i,j),j=1,4),a
   if (trim(a)=="YES") then
       y(x(i,1))=y(x(i,1))+1
       y(x(i,2))=y(x(i,2))+1
       y(x(i,3))=y(x(i,3))+1
       y(x(i,4))=y(x(i,4))+1
   else
       y(x(i,1))=y(x(i,1))-1
       y(x(i,2))=y(x(i,2))-1
       y(x(i,3))=y(x(i,3))-1
       y(x(i,4))=y(x(i,4))-1
   end if
end do

write(*,*) maxloc(y)-1
end
0