Submission #75203196


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

mt19937_64    rng(chrono::steady_clock::now().time_since_epoch().count());

#define       nline                     "\n"
#define       pb                        push_back
#define       ppb                       pop_back
#define       mp                        make_pair
#define       ff                        first
#define       ss                        second
#define       fall(x, n)                for(int x=0; x<n; x++)
#define       rall(x, n)                for(int x=n-1; x>=0; x--)
#define       frange(x, start, end)     for(int x=start; x<=end; x++)
#define       rrange(x, start, end)     for(int x=start; x>=end; x--)
#define       in(i, v)                  for(auto &i: v) cin >> i;
#define       vi                        vector<int>
#define       ii                        pair<int, int>
#define       sz(x)                     ((int)(x).size())
#define       all(x)                    (x).begin(), (x).end()
#define       mod                       1000000007
#define       INF                       0x1fffffffffffffffLL

typedef       long long                 ll;
typedef       unsigned long long        ull;
typedef       long double               lld;

#ifdef        LOCAL
#include      "debug.h"
#else
#define       debug(x)
#endif

#define       int                       long long

void solve()
{
    int n, a, b; cin >> n >> a >> b;
    string s; cin >> s;
    frange(i, a, n - b - 1) cout << s[i]; cout << nline;
}

signed main()
{
#ifdef LOCAL
    freopen("i.txt", "r", stdin); freopen("o.txt", "w", stdout); freopen("e.txt", "w", stderr);
#endif
    auto begin = chrono::high_resolution_clock::now();
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int t = 1;
    while (t--) solve();
    auto end = chrono::high_resolution_clock::now();
    auto elapsed = chrono::duration_cast<chrono::nanoseconds>(end - begin);
    cerr << fixed << "Time measured <= *_* => " << elapsed.count() * 1e-9 << " seconds.\n";
    return 0;
}

Submission Info

Submission Time
Task B - A Substring
User kumaresh_rk
Language C++23 (GCC 15.2.0)
Score 100
Code Size 2068 Byte
Status AC
Exec Time 1 ms
Memory 3940 KiB

Compile Error

./Main.cpp: In function 'void solve()':
./Main.cpp:15:41: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   15 | #define       frange(x, start, end)     for(int x=start; x<=end; x++)
      |                                         ^~~
./Main.cpp:41:5: note: in expansion of macro 'frange'
   41 |     frange(i, a, n - b - 1) cout << s[i]; cout << nline;
      |     ^~~~~~
./Main.cpp:41:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   41 |     frange(i, a, n - b - 1) cout << s[i]; cout << nline;
      |                                           ^~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 10
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_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
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3836 KiB
00_sample_01.txt AC 1 ms 3872 KiB
00_sample_02.txt AC 1 ms 3836 KiB
01_random_03.txt AC 1 ms 3872 KiB
01_random_04.txt AC 1 ms 3832 KiB
01_random_05.txt AC 1 ms 3876 KiB
01_random_06.txt AC 1 ms 3876 KiB
01_random_07.txt AC 1 ms 3940 KiB
01_random_08.txt AC 1 ms 3804 KiB
01_random_09.txt AC 1 ms 3940 KiB