結果
| 問題 |
No.495 (^^*) Easy
|
| コンテスト | |
| ユーザー |
@abcde
|
| 提出日時 | 2019-02-14 22:49:51 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 578 bytes |
| コンパイル時間 | 1,253 ms |
| コンパイル使用メモリ | 161,728 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 11:34:27 |
| 合計ジャッジ時間 | 1,836 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
// 1. 入力情報取得.
string S;
cin >> S;
// 2. 汚れて読めない1つの文字は?
string const LEFT = "(^^*)";
string const RIGHT = "(*^^)";
int lAns = 0;
int rAns = 0;
for(int i = 0; i < S.size(); i += 5){
if(S[i] == '#') break;
string s = {S[i], S[i + 1], S[i + 2], S[i + 3], S[i + 4]};
if(LEFT == s) lAns++;
if(RIGHT == s) rAns++;
}
// 3. 後処理.
cout << lAns << " " << rAns << endl;
return 0;
}
@abcde