Submission #67551719
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int N=3e5+10;
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
map<int,int> mp;
int n,m,k;
int a[N],b[N];
char c[N];
void slove(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>c[i]>>a[i];
}
int coun=0;
string s="";
for(int i=1;i<=n;i++){
for(int j=1;j<=a[i];j++){
s+=c[i];
coun++;
if(coun>100){cout<<"Too Long"<<endl;return;}
}
}
// cout<<coun<<endl;
for(int i=0;i<coun;i++){
cout<<s[i];
}
cout<<endl;
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T=1;
// cin>>T;
while(T--){
slove();
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - String Too Long |
| User | Maikan |
| Language | C++ 20 (gcc 12.2) |
| Score | 200 |
| Code Size | 756 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3576 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 | 3416 KiB |
| 00_sample_01.txt | AC | 1 ms | 3404 KiB |
| 00_sample_02.txt | AC | 1 ms | 3488 KiB |
| 00_sample_03.txt | AC | 1 ms | 3432 KiB |
| 01_test_00.txt | AC | 1 ms | 3364 KiB |
| 01_test_01.txt | AC | 1 ms | 3556 KiB |
| 01_test_02.txt | AC | 1 ms | 3560 KiB |
| 01_test_03.txt | AC | 1 ms | 3496 KiB |
| 01_test_04.txt | AC | 1 ms | 3496 KiB |
| 01_test_05.txt | AC | 1 ms | 3436 KiB |
| 01_test_06.txt | AC | 1 ms | 3492 KiB |
| 01_test_07.txt | AC | 1 ms | 3496 KiB |
| 01_test_08.txt | AC | 1 ms | 3428 KiB |
| 01_test_09.txt | AC | 1 ms | 3324 KiB |
| 01_test_10.txt | AC | 1 ms | 3560 KiB |
| 01_test_11.txt | AC | 1 ms | 3432 KiB |
| 01_test_12.txt | AC | 1 ms | 3364 KiB |
| 01_test_13.txt | AC | 1 ms | 3576 KiB |
| 01_test_14.txt | AC | 1 ms | 3544 KiB |
| 01_test_15.txt | AC | 1 ms | 3500 KiB |
| 01_test_16.txt | AC | 1 ms | 3564 KiB |
| 01_test_17.txt | AC | 1 ms | 3436 KiB |