# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
147790 | gina (#201) | Get Hundred Points! (FXCUP4_hundred) | C++17 | 9 ms | 384 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.
#include "hundred.h"
#include <bits/stdc++.h>
using namespace std;
string solve(int An, int Bn, char A, char B) {
string ans;
for(int i = 0; i < 100; i++) ans.push_back(B);
if(An == 0) return ans;
int res[100];
string s;
for(int i = 0; i < An - 1; i++) s.push_back(A);
for(int i = An - 1; i < 100; i++) s.push_back(B);
for(int i = 50; i < 100; i++) {
s[i] = A;
res[i] = Mark(s);
s[i] = B;
}
int mn = 100, mx = 0;
for(int i = 50; i < 100; i++) {
mn = min(mn, res[i]);
mx = max(mx, res[i]);
}
for(int i = 50; i < 100; i++) if(res[i] > mn) ans[i] = A;
if(mn == mx && res[50] == 2) for(int i = 50; i < 100; i++) ans[i] = A;
for(int i = 0; i < Bn + 1; i++) s[i] = B;
for(int i = Bn + 1; i < 100; i++) s[i] = A;
for(int i = 0; i < 50; i++) {
s[i] = A;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |