답안 #1082838

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1082838 2024-09-01T17:26:17 Z boyliguanhan 가로등 (APIO19_street_lamps) C++17
20 / 100
6 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
bitset<101> bt[101];
int main(){
    int n,q;
    cin>>n>>q;
    for(int i=1;i<=n;i++){
        char x;
        cin>>x;
        bt[0][i]=x-'0';
    }

    for(int i=1;i<=q;i++){
        string str;
        cin>>str;
        bt[i]=bt[i-1];
        if(str=="toggle"){
            int x;
            cin>>x;
            bt[i][x]=!bt[i][x];
        } else {
            int a,b;
            cin>>a>>b;
            int ans=0;
            for(int j=0;j<i;j++){
                int v=1;
                for(int k=a;k<b;k++)
                    v&=bt[j][k];
                ans+=v;
            }
            cout<<ans<<'\n';
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Runtime error 1 ms 348 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -