結果

問題 No.607 開通777年記念
ユーザー BQZetBQZet
提出日時 2017-12-11 16:24:41
言語 Fortran
(gFortran 13.2.0)
結果
TLE  
実行時間 -
コード長 494 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 34,220 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-05-07 17:07:53
合計ジャッジ時間 5,561 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,624 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

integer::N,M,i,j,k,switch=0
integer,allocatable,dimension(:,:)::a,b

read *,N,M
allocate(a(M,N),b(M+1,N))

do i=1,M
 read *,a(i,:)
end do
do j=1,N
 b(1,j)=a(1,j)
end do

do i=1,M
 do j=1,N
  do k=1,N
   if(sum(b(i,j:k))==777) then
    switch=1
   end if
   if(sum(b(i,j:k))>=777) exit
  end do
  if(sum(b(i,j:k))==777) exit
  b(i+1,j)=b(i,j)+a(i+1,j)
 end do
 if(sum(b(i,j:k))==777) exit
end do

if(switch==1) then 
 print *,'YES'
else
 print *,'NO'
end if

end
0