結果
問題 | No.539 インクリメント |
ユーザー |
![]() |
提出日時 | 2017-07-01 00:01:35 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 779 bytes |
コンパイル時間 | 1,188 ms |
コンパイル使用メモリ | 32,136 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-10-04 22:00:39 |
合計ジャッジ時間 | 1,917 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 1 |
ソースコード
program mainimplicit noneinteger::N,i,j,first,lastcharacter*100001::S=""character*10::num='0123456789'read *,Ndo i=1,Nread '(a)',Slast = scan(S,num,.true.)if(last.eq.0) thenprint '(a)', TRIM(S)cycleend iffirst= verify(S(1:last),num,.true.)if(S(first+1:last).eq.REPEAT('9',last-first)) thendo j=LEN_TRIM(S), last, -1S(j+1:j+1) = S(j:j)end doS(first+1:first+1) = '1'S(first+2:last+1) = REPEAT('0',last-first)elsefirst = verify(S(1:last),'9',.true.)S(first:first)=ACHAR(ICHAR(S(first:first))+1)if(first.ne.last) thenS(first+1:last)='0'end ifend ifprint '(a)', TRIM(S)end doend program main