結果

問題 No.495 (^^*) Easy
ユーザー seiichi3141
提出日時 2017-07-13 10:26:56
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 1,290 ms
コンパイル使用メモリ 157,560 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-07 18:05:04
合計ジャッジ時間 1,770 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s", S);
      |         ~~~~~^~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char **argv) {
	char S[100001];
	scanf("%s", S);

	int l = 0;
	int r = 0;
	for (int i = 0; S[i] != '#'; i += 5) {
		if (S[i + 1] == '^') {
			l++;
		} else {
			r++;
		}
	}
	printf("%d %d\n", l, r);
	return 0;
}
0