| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360177 | MuhammadSaram | Street Lamps (APIO19_street_lamps) | C++20 | 5091 ms | 589824 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,q;
cin>>n>>q;
string tog[q+1];
cin>>tog[0];
for (int i=1;i<=q;i++)
{
string s;
cin>>s;
tog[i]=tog[i-1];
if (s=="toggle")
{
int x;
cin>>x;x--;
tog[i][x]='1'-tog[i][x]+'0';
}
else
{
int a,b;
cin>>a>>b;a--, b--;
int ans=0;
for (int j=0;j<i;j++)
{
bool pos=1;
for (int k=a;k<b;k++)
if (tog[j][k]=='0')
{
pos=0;
break;
}
ans+=pos;
}
cout<<ans<<endl;
}
}
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
