Submission #60045433
Source Code Expand
Copy
#include <bits/stdc++.h>#define CNO cout << "No\n"#define CYES cout << "Yes\n"#define endl '\n'#define ls id << 1#define rs id << 1 | 1#define llen (mid - l + 1)#define rlen (r - mid)using namespace std;using ll = long long;using uint = unsigned int;using ull = unsigned long long;using ld = long double;using i128 = __int128;using pii = pair<int, int>;using pll = pair<ll, ll>;const ll mod = 998244353;const int N = 200010;int n, arr[N];ll ans = 0;string str;
#include <bits/stdc++.h> #define CNO cout << "No\n" #define CYES cout << "Yes\n" #define endl '\n' #define ls id << 1 #define rs id << 1 | 1 #define llen (mid - l + 1) #define rlen (r - mid) using namespace std; using ll = long long; using uint = unsigned int; using ull = unsigned long long; using ld = long double; using i128 = __int128; using pii = pair<int, int>; using pll = pair<ll, ll>; const ll mod = 998244353; const int N = 200010; int n, arr[N]; ll ans = 0; string str; template <class T> void chmax(T &a, T b) { if (a < b) a = b; } template <class T> void chmin(T &a, T b) { if (a > b) a = b; } int main() { ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); int T = 1; // cin >> T; while (T--) { cin >> n >> str; ans = 0; int p = -1; for (int i = 0; i < n; ++i) { if (str[i] == '/') { int l = i, r = i; while (l - 1 > p && r + 1 < n && str[l - 1] == '1' && str[r + 1] == '2') { l--, r++; } chmax<ll>(ans, r - l + 1); p = r; } } cout << ans << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 11/22 Substring |
User | Arch_Srginit |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 1263 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 3716 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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_00.txt, 01_random_01.txt, 01_random_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, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 02_corner_00.txt, 02_corner_01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3640 KB |
00_sample_01.txt | AC | 1 ms | 3496 KB |
00_sample_02.txt | AC | 1 ms | 3516 KB |
01_random_00.txt | AC | 2 ms | 3616 KB |
01_random_01.txt | AC | 2 ms | 3620 KB |
01_random_02.txt | AC | 2 ms | 3620 KB |
01_random_03.txt | AC | 2 ms | 3612 KB |
01_random_04.txt | AC | 2 ms | 3620 KB |
01_random_05.txt | AC | 2 ms | 3544 KB |
01_random_06.txt | AC | 2 ms | 3632 KB |
01_random_07.txt | AC | 2 ms | 3612 KB |
01_random_08.txt | AC | 2 ms | 3716 KB |
01_random_09.txt | AC | 2 ms | 3572 KB |
01_random_10.txt | AC | 2 ms | 3636 KB |
01_random_11.txt | AC | 2 ms | 3572 KB |
01_random_12.txt | AC | 2 ms | 3636 KB |
01_random_13.txt | AC | 2 ms | 3628 KB |
01_random_14.txt | AC | 2 ms | 3636 KB |
01_random_15.txt | AC | 1 ms | 3712 KB |
01_random_16.txt | AC | 1 ms | 3680 KB |
01_random_17.txt | AC | 2 ms | 3552 KB |
01_random_18.txt | AC | 2 ms | 3576 KB |
01_random_19.txt | AC | 2 ms | 3548 KB |
02_corner_00.txt | AC | 1 ms | 3576 KB |
02_corner_01.txt | AC | 1 ms | 3500 KB |