結果
問題 |
No.495 (^^*) Easy
|
ユーザー |
![]() |
提出日時 | 2018-02-27 09:47:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 588 bytes |
コンパイル時間 | 564 ms |
コンパイル使用メモリ | 65,772 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-27 19:00:53 |
合計ジャッジ時間 | 1,123 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
// No.495 (^^*) Easy // https://yukicoder.me/problems/no/495 // #include <iostream> #include <string> using namespace std; pair<int, int> solve(string &S); int main() { string S; cin >> S; pair<int, int> res = solve(S); cout << res.first << " " << res.second << endl; } pair<int, int> solve(string &S) { int lefty = 0; int righty = 0; for (auto i = 1; i < S.size(); i++) { if (S[i] == '*') { if (S[i-1] == '^') lefty++; else righty++; } } return make_pair(lefty, righty); }