Submission #50680808
Source Code Expand
#include <bits/stdc++.h> #ifdef LOCAL #include "debug.h" #else #define debug(...) #endif using int64 = long long; using uint = unsigned int; using uint64 = unsigned long long; bool ckmin(auto& a, auto b) { return b < a ? a = b, 1 : 0; } bool ckmax(auto& a, auto b) { return b > a ? a = b, 1 : 0; } using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; vector<int> cnt(26); for (char ch : s) cnt[ch - 'a']++; for (int i = 0; i < (int)s.length(); i++) { if (cnt[s[i] - 'a'] == 1) { cout << i + 1 << endl; break; } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Yay! |
User | xindubawukong |
Language | C++ 20 (gcc 12.2) |
Score | 150 |
Code Size | 644 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3592 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 150 / 150 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 1 ms | 3488 KiB |
00_sample_02.txt | AC | 1 ms | 3452 KiB |
00_sample_03.txt | AC | 1 ms | 3436 KiB |
01_test_01.txt | AC | 1 ms | 3504 KiB |
01_test_02.txt | AC | 1 ms | 3384 KiB |
01_test_03.txt | AC | 1 ms | 3500 KiB |
01_test_04.txt | AC | 1 ms | 3560 KiB |
01_test_05.txt | AC | 1 ms | 3512 KiB |
01_test_06.txt | AC | 1 ms | 3512 KiB |
01_test_07.txt | AC | 1 ms | 3436 KiB |
01_test_08.txt | AC | 1 ms | 3404 KiB |
01_test_09.txt | AC | 1 ms | 3592 KiB |
01_test_10.txt | AC | 1 ms | 3408 KiB |