Thank you for your hard work in the 3rd qualifying session of JOI 2019/2020. Only B problem was solved during the contest. There is a commentary, so it should be open to the public. Languages used: C ++, Python3
L <= X <= R At the time of, X is output.
R < X At the time, R is output.
A.cpp
#include <iostream>
using namespace std;
int main(){
int X;
int L;
int R;
cin >> X >> L >> R;
if(X < L){
cout << L << endl;
}
else if(L <= X and X <= R){
cout << X << endl;
}
else if(R < X){
cout << R << endl;
}
}
that's all.
Replace the string "joi" with "JOI" using the Python3 replace function.
B.py
N, S = int(input())
print(S.replace('joi', 'JOI'))
that's all.
It's a C problem, but I'm disappointed that I couldn't solve the A problem during the contest.
Recommended Posts