답안 #719490

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
719490 2023-04-06T05:37:03 Z keisuke6 가로등 (APIO19_street_lamps) C++14
20 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N,Q;
  string s;
  cin>>N>>Q>>s;
  vector<string> S={};
  for(int i=0;i<Q;i++){
    S.push_back(s);
    string q;
    cin>>q;
    if(q[0] != 'q'){
      int a;
      cin>>a;
      s[a-1] = '1'-s[a-1]+'0';
      continue;
    }
    int l,r;
    cin>>l>>r;
    l--;
    r--;
    int ans = 0;
    for(string ss:S){
      bool ok = true;
      for(int j=l;j<r;j++)if(ss[j] == '0') ok = false;
      ans += ok;
    }
    cout<<ans<<endl;
  }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5076 ms 4136 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1236 KB Output is correct
2 Correct 37 ms 1268 KB Output is correct
3 Correct 71 ms 1260 KB Output is correct
4 Correct 139 ms 1308 KB Output is correct
5 Runtime error 1204 ms 524288 KB Execution killed with signal 9
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 116 ms 1224 KB Output is correct
2 Correct 105 ms 1220 KB Output is correct
3 Correct 65 ms 1288 KB Output is correct
4 Correct 6 ms 1236 KB Output is correct
5 Runtime error 190 ms 524288 KB Execution killed with signal 9
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Execution timed out 5076 ms 4136 KB Time limit exceeded
9 Halted 0 ms 0 KB -