| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1360177 | MuhammadSaram | 가로등 (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;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
