結果

問題 No.495 (^^*) Easy
ユーザー HimatsubushinHimatsubushin
提出日時 2023-07-12 14:28:54
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 521 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 27,836 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-12 04:47:50
合計ジャッジ時間 764 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SIZE 100000

int main(void) {
    int i, left, right;
    char str[SIZE + 1];
    char face[6], *ptr;

    scanf("%s", str);
    ptr = str;
    left = right = 0;
    face[5] = '\0';

    for (;;) {
        if (*ptr == '#')
            break;
        
        for (i = 0; i < 5; i++)
            face[i] = *ptr++;

        if (strcmp(face, "(^^*)") == 0)
            left++;
        else
            right++;
    }

    printf("%d %d\n", left, right);
}
0