| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1360076 | Faisal_Saqib | Street Lamps (APIO19_street_lamps) | C++20 | 3 ms | 580 KiB |
#include <iostream>
using namespace std;
const int N=200;
int s[N][N];
void solve()
{
int n,q;
cin>>n>>q;
for(int i=0;i<n;i++)
{
char c;
cin>>c;
s[0][i]=c-'0';
}
for(int i=1;i<=q;i++)
{
for(int j=0;j<n;j++)
{
s[i][j]=s[i-1][j];
}
string cs;
cin>>cs;
if(cs[0]=='t')
{
int k;
cin>>k;
k--;
s[i][k]^=1;
}
else
{
int a,b;
cin>>a>>b;
a--;
b--;
int fnl=0;
for(int tt=0;tt<i;tt++)
{
bool cur=1;
for(int j=a;j<b;j++)
{
cur&=(s[tt][j]);
}
fnl+=cur;
}
cout<<fnl<<endl;
}
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t=1;
// cin>>t;
while(t--)solve();
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
