| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 77828 | sh25_wangtaojie | 字符串p型编码 | C++ | Accepted | 0 MS | 252 KB | 412 | 2025-12-26 14:52:15 |
#include <iostream> #include <string> using namespace std; int main() { string str; cin >> str; string encoded; for (int i = 0; i < str.length(); ++i) { int count = 1; while (i + 1 < str.length() && str[i] == str[i + 1]) { ++count; ++i; } encoded += to_string(count) + str[i]; } cout << encoded; return 0; }