Submission #52333458
Source Code Expand
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <unordered_map>
using namespace std;
int main() {
string s; cin >> s;
unordered_map<char, int> Map;
for (int i = 0; i < s.length(); i++) Map[s[i]]++;
bool t = true;
vector<string> a(101);
for (char c = 'a'; c <= 'z'; c++) a[Map[c]].push_back(c);
for (int i = 1; i < a.size(); i++) if (!(a[i].length() == 0 || a[i].length() == 2)) t = false;
if (t) cout << "Yes" << endl;
else cout << "No" << endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Commencement |
| User | H_Tatsuhiro |
| Language | C++ 23 (gcc 12.2) |
| Score | 200 |
| Code Size | 523 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3672 KiB |
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:10:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
10 | for (int i = 0; i < s.length(); i++) Map[s[i]]++;
| ~~^~~~~~~~~~~~
Main.cpp:14:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
14 | for (int i = 1; i < a.size(); i++) if (!(a[i].length() == 0 || a[i].length() == 2)) t = false;
| ~~^~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| 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_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3444 KiB |
| 00_sample_02.txt | AC | 1 ms | 3516 KiB |
| 00_sample_03.txt | AC | 1 ms | 3400 KiB |
| 01_random_01.txt | AC | 1 ms | 3668 KiB |
| 01_random_02.txt | AC | 1 ms | 3400 KiB |
| 01_random_03.txt | AC | 1 ms | 3672 KiB |
| 01_random_04.txt | AC | 1 ms | 3532 KiB |
| 01_random_05.txt | AC | 1 ms | 3408 KiB |
| 01_random_06.txt | AC | 1 ms | 3532 KiB |
| 01_random_07.txt | AC | 1 ms | 3404 KiB |
| 01_random_08.txt | AC | 1 ms | 3548 KiB |
| 01_random_09.txt | AC | 1 ms | 3440 KiB |
| 01_random_10.txt | AC | 1 ms | 3524 KiB |
| 02_handmade_01.txt | AC | 1 ms | 3528 KiB |
| 02_handmade_02.txt | AC | 1 ms | 3528 KiB |
| 02_handmade_03.txt | AC | 1 ms | 3548 KiB |
| 02_handmade_04.txt | AC | 1 ms | 3440 KiB |