結果

問題 No.2773 Wake up Record 1
ユーザー 2475057t
提出日時 2024-07-09 22:33:45
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 29,696 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-09 22:33:48
合計ジャッジ時間 1,737 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

//Wake up Record 1
#include <stdio.h>
#include <string.h>

int main(void){
    int N, cnt = 0;
    scanf("%d", &N);
    char s[N+1];
    int k[N];
    scanf("%s", s);
    
    for(int i=1; i<N; i++){
        if((s[i-1]=='x') && (s[i]=='o')){
            k[cnt] = i + 1;
            cnt++;
        }
        else{}
    }
    
    printf("%d\n", cnt);
    for(int i=0; i<cnt; i++){
        printf("%d ", k[i]);
    }
    printf("\n");

    return 0;
}
0