Submission #67513858
Source Code Expand
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define endl '\n'
#define pb push_back
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int ll
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int,int>;
using iii = tuple<int,int,int>;
const int inf = 2e9+1;
const int mod = 1e9+7;
const int maxn = 3e5+100;
template<typename X, typename Y> bool ckmin(X& x, const Y& y) { return (y < x) ? (x=y,1):0; }
template<typename X, typename Y> bool ckmax(X& x, const Y& y) { return (x < y) ? (x=y,1):0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r) {
uniform_int_distribution<int> uid(l, r);
return uid(rng);
}
void solve() {
int n; cin >> n;
string sexo;
for (int i = 0; i < n; ++i) {
char c; int l; cin >> c >> l;
if (sz(sexo) + l > 100) {
cout << "Too Long" << endl;
exit(0);
}
for (int j = 0; j < l; ++j) sexo += c;
}
cout << sexo << endl;
}
int32_t main() {_
#ifndef gato
int t = 1; //cin >> t;
while(t--) solve();
#else
int t = 1;
while (true) {
int my = solve(), ans = brute();
if (my != ans) {
cout << "Wrong answer on test " << t << endl;
cout << "Your output: " << my << endl;
cout << "Answer: " << ans << endl;
exit(0);
}
cout << "Accepted on test " << t++ << endl;
}
#endif
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - String Too Long |
| User | perchuts |
| Language | C++ 20 (gcc 12.2) |
| Score | 200 |
| Code Size | 1591 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3604 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_00.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, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3516 KiB |
| 00_sample_01.txt | AC | 1 ms | 3328 KiB |
| 00_sample_02.txt | AC | 1 ms | 3604 KiB |
| 00_sample_03.txt | AC | 1 ms | 3456 KiB |
| 01_test_00.txt | AC | 1 ms | 3460 KiB |
| 01_test_01.txt | AC | 1 ms | 3540 KiB |
| 01_test_02.txt | AC | 1 ms | 3472 KiB |
| 01_test_03.txt | AC | 1 ms | 3476 KiB |
| 01_test_04.txt | AC | 1 ms | 3484 KiB |
| 01_test_05.txt | AC | 1 ms | 3384 KiB |
| 01_test_06.txt | AC | 1 ms | 3524 KiB |
| 01_test_07.txt | AC | 1 ms | 3452 KiB |
| 01_test_08.txt | AC | 1 ms | 3524 KiB |
| 01_test_09.txt | AC | 1 ms | 3468 KiB |
| 01_test_10.txt | AC | 1 ms | 3476 KiB |
| 01_test_11.txt | AC | 1 ms | 3480 KiB |
| 01_test_12.txt | AC | 1 ms | 3520 KiB |
| 01_test_13.txt | AC | 1 ms | 3524 KiB |
| 01_test_14.txt | AC | 1 ms | 3604 KiB |
| 01_test_15.txt | AC | 1 ms | 3476 KiB |
| 01_test_16.txt | AC | 1 ms | 3380 KiB |
| 01_test_17.txt | AC | 1 ms | 3472 KiB |