# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
908134 | 2024-01-16T08:23:48 Z | Alfraganus | Lamps (JOI19_lamps) | C++17 | 6 ms | 4540 KB |
#pragma GCC optimize("unroll-loops") #pragma gcc optimize("Ofast") #pragma GCC optimization("Ofast") #pragma optimize(Ofast) #include <bits/stdc++.h> using namespace std; #define int long long #define str string #define fastio ios::sync_with_stdio(0), cin.tie(0); #define fs first #define ss second #define endl '\n' #define all(x) (x).begin(), (x).end() #define len(x) x.size() #define print(a) \ for (auto &x : a) \ cout << x << " "; \ cout << endl; #define printmp(a) \ for (auto &x : a) \ cout << x.fs << " " << x.ss << endl; const int mod = 998244353; void solve(){ int n; cin >> n; str a, b; cin >> a >> b; int ans = 0, l = 0, r = 0; while(l < n){ while(r < n and b[r] == '1') r ++; if(r != l) ans ++; r ++; l = r; } cout << ans; } signed main() { fastio int t = 1; // cin >> t; while (t--) { solve(); cout << endl; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 6 ms | 4440 KB | Output is correct |
8 | Correct | 6 ms | 4520 KB | Output is correct |
9 | Correct | 6 ms | 4528 KB | Output is correct |
10 | Correct | 5 ms | 4520 KB | Output is correct |
11 | Correct | 6 ms | 4540 KB | Output is correct |
12 | Correct | 5 ms | 4344 KB | Output is correct |
13 | Correct | 6 ms | 4340 KB | Output is correct |
14 | Correct | 6 ms | 4396 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |