# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202050 | khohko | JJOOII 2 (JOI20_ho_t2) | C++17 | 22 ms | 3848 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ARRS ((ll)(4e5+100))
#define fr first
#define sc second
#define pb push_back
#define MX ((ll)(1e9+100))
#define MAX ((ll)(1e18+100))
ll n;
pair<ll,ll> a[ARRS];
ll b[ARRS];
ll ans[ARRS];
ll pl[ARRS];
ll pr[ARRS];
int main(){
ll n,m;
string s;
cin>>n>>m;
cin>>s;
ll l=0,r=0,c=0;
for(r=0; r<n&&c!=m; r++){
c+=s[r]=='J';
pl[r]=MAX;
}
if(c<m){
cout<<-1;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |