| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 267374 | blue | Street Lamps (APIO19_street_lamps) | C++11 | 5088 ms | 69132 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 <iostream>
#include <string>
using namespace std;
int main()
{
int n, q;
cin >> n >> q;
string S;
cin >> S;
bool on[n+1];
for(int i = 1; i <= n; i++) on[i] = S[i-1] == '1';
int drive[n+1][n+2];
for(int a = 1; a <= n; a++) for(int b = a; b <= n+1; b++) drive[a][b] = 0;
int A, B;
for(int i = 1; i <= q; i++)
{
for(int a = 1; a <= n; a++)
{
for(int b = a+1; b <= n+1; b++)
{
if(!on[b-1]) break;
drive[a][b]++;
}
}
cin >> S;
if(S == "toggle")
{
cin >> A;
on[A] = !on[A];
}
else
{
cin >> A >> B;
cout << drive[A][B] << '\n';
}
}
}
| # | 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... | ||||
