結果

問題 No.2035 Tunnel
ユーザー もふもふ神もふもふ神
提出日時 2022-08-15 20:18:54
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 29,952 KB
実行使用メモリ 13,880 KB
最終ジャッジ日時 2024-04-10 06:58:39
合計ジャッジ時間 5,056 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 OLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#define N 300000

int main(void){
    char S[N];
    int n,counter = 0;
    scanf("%d",&n);
    scanf("%s",&S);
loop:
    if(S[n-1] == '#') S[n-1] = '.';
    for(int i=0;i<n-1;i++)
    {
        if(S[i] == '#' && S[i+1] == '.')
        {
            S[i] = '.';
            S[i+1] = '#';
            i = i + 1;
        }
    }
    printf("%s\n",S);
    for(int i=0;i<n;i++){
        if(S[i] == '#')
        {
            counter++;
            goto loop;
        }
    }
    counter++;
    goto end;
end:
    printf("%d",counter);
    return 0;
}
0