| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1369765 | FaresSTH | Tornjevi (COCI25_tornjevi) | C++20 | 877 ms | 1212 KiB |
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
#define S second
#define F first
int main(){
cin.tie(0)->sync_with_stdio(0);
int n,q;
string s;
cin>>n>>q>>s;
while(q--){
int l,r;
cin>>l>>r;
int a=0,b=0;l--,r--;
for(int i=l;i<=r;i++){
if(s[i]=='P'){
a++;
b--;
continue;
}
b++;
a--;
}
if(a<0)a=-a;
if(b<0)b=-b;
cout<<a+b<<'\n';
}
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
