Submission #67529181


Source Code Expand

/*
~~ Alguma parte/frase foda de um livro/mangá para dar sorte ~~

Uma vez eu gritei, gradualmente, perdi minha voz.
Uma vez eu chorei, gradualmente, perdi minhas lágrimas.
Uma vez eu sofri, gradualmente, me tornei capaz de suportar tudo.
Uma vez me alegrei, gradualmente, me tornei indiferente ao mundo.
E agora, tudo o que me resta é um rosto sem expressão,
meu olhar é tão firme quanto um monólito,
apenas a perseverança permanece no meu coração.
Este sou eu, um personagem insignificante,
Fang Yuan — A Perseverança.

*/
#if defined(LOCAL) or not defined(LUOGU)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,unroll-loops")
#endif

#include <bits/stdc++.h>
//#include <chatgpt.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

template <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename T>
ostream& operator<<(ostream &os, const vector<T> &v) {
    os << "[";
    for (size_t i = 0; i < v.size(); ++i) {
        os << v[i] << (i + 1 == v.size() ? "" : ", ");
    }
    os << "]";
    return os;
}

void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T)
{
    cerr << ' ' << H;
    dbg_out(T...);
}
#define dbg(...) cerr << "(" << _VA_ARGS_ << "):", dbg_out(_VA_ARGS_), cerr << endl

#define int long long
#define IOS                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(0)
#define TXTIO                           \
    freopen("entrada.in", "r", stdin);\
    freopen("saida.out", "w", stdout)
#define pb push_back
#define all(v) v.begin(), v.end()
#define f first
#define s second
#define Unique(v)                     \
    sort(all(v));                     \
    v.erase(unique(all(v)), v.end()); \
    v.shrink_to_fit()
#define sz(v) ((int)v.size())
#define sor(x) sort(all(x))
#define ft front()
#define bk back()
#define endl "\n"
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef long long ll;
typedef double db;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<pii> vii;
typedef vector<piii> viii;
typedef tuple<int, int, int> tiii;
const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
const int mod = 1e9 + 7;
const int LOGN = 21;

void solve()
{
    int n; cin >> n;
    string s;
    int acc = 0;
    bool too_long = false;
    rep(i,0,n){
        char c; cin >> c;
        int q; cin >> q;
        acc += q;
        if(acc > 100)
            too_long = true;
        if(!too_long)
            s += string(q, c);
    }
    cout << (!too_long ? s : "Too Long") << endl;
}

int32_t main()
{
    IOS;
    int tt;
    tt = 1;
    while (tt --> 0)
        solve();
    return 0;
}

Submission Info

Submission Time
Task B - String Too Long
User Marcux777
Language C++ 20 (gcc 12.2)
Score 200
Code Size 3315 Byte
Status AC
Exec Time 1 ms
Memory 3608 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 22
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 3384 KiB
00_sample_01.txt AC 1 ms 3420 KiB
00_sample_02.txt AC 1 ms 3392 KiB
00_sample_03.txt AC 1 ms 3420 KiB
01_test_00.txt AC 1 ms 3328 KiB
01_test_01.txt AC 1 ms 3400 KiB
01_test_02.txt AC 1 ms 3476 KiB
01_test_03.txt AC 1 ms 3412 KiB
01_test_04.txt AC 1 ms 3464 KiB
01_test_05.txt AC 1 ms 3416 KiB
01_test_06.txt AC 1 ms 3476 KiB
01_test_07.txt AC 1 ms 3452 KiB
01_test_08.txt AC 1 ms 3536 KiB
01_test_09.txt AC 1 ms 3424 KiB
01_test_10.txt AC 1 ms 3476 KiB
01_test_11.txt AC 1 ms 3444 KiB
01_test_12.txt AC 1 ms 3524 KiB
01_test_13.txt AC 1 ms 3484 KiB
01_test_14.txt AC 1 ms 3536 KiB
01_test_15.txt AC 1 ms 3468 KiB
01_test_16.txt AC 1 ms 3608 KiB
01_test_17.txt AC 1 ms 3472 KiB