# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
969508 | SorahISA | Flip it and Stick it (CCO23_day2problem1) | C++17 | 4 ms | 1272 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#ifndef SorahISA
#define SorahISA
#include SorahISA __FILE__ SorahISA
int Count(const string &S, const string &T) {
if (SZ(T) == 1) return count(ALL(S), T[0]);
int cnt = 0;
for (int i = 0; i <= SZ(S)-SZ(T); ++i) {
if (S.substr(i, SZ(T)) == T) ++cnt;
}
return cnt;
}
int solve0(string S) {
if (Count(S, "0")) return -1;
return 0;
}
int solve00(string S) {
if (Count(S, "0") > Count(S, "1") + 1) return -1;
return Count(S, "00");
}
int solve01(string S) {
return (S.front() == '0') + (S.back() == '1') + Count(S, "10") - 1;
}
int solve000(string S) {
if (Count(S, "0") > Count(S, "1") * 2 + 2) return -1;
int ans = 0, n_adj = 0, n_single = 0, n_even = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |