Submission #36221764
Source Code Expand
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
typedef long long ll;
using namespace std;
const int maxn = 105;
int n;
char a[maxn];
int main() {
#ifdef DEBUG
freopen("1.in", "r", stdin);
#endif
ios::sync_with_stdio(0);
cin.tie(0);
cin >> (a + 1);
n = strlen(a + 1);
int ans = -1;
for(int i = 1; i <= n; i++) {
if(a[i] == 'a') {
ans = i;
}
}
cout << ans << '\n';
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Rightmost |
| User | yanchengzhi |
| Language | C++ (GCC 9.2.1) |
| Score | 100 |
| Code Size | 499 Byte |
| Status | AC |
| Exec Time | 7 ms |
| Memory | 3584 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 7 ms | 3536 KiB |
| example_01.txt | AC | 2 ms | 3584 KiB |
| example_02.txt | AC | 2 ms | 3448 KiB |
| test_00.txt | AC | 2 ms | 3504 KiB |
| test_01.txt | AC | 2 ms | 3472 KiB |
| test_02.txt | AC | 2 ms | 3440 KiB |
| test_03.txt | AC | 2 ms | 3440 KiB |
| test_04.txt | AC | 2 ms | 3440 KiB |
| test_05.txt | AC | 2 ms | 3484 KiB |
| test_06.txt | AC | 2 ms | 3484 KiB |
| test_07.txt | AC | 2 ms | 3464 KiB |
| test_08.txt | AC | 2 ms | 3468 KiB |
| test_09.txt | AC | 2 ms | 3536 KiB |
| test_10.txt | AC | 3 ms | 3476 KiB |