답안 #242458

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
242458 2020-06-27T18:17:05 Z MatesV13 Ljetopica (COI19_ljetopica) C++11
0 / 100
5 ms 512 KB
#include <bits/stdc++.h>
using namespace std;
long long n, k, ans, mod=1000000007;
string upute, l, r, rj1, rj2;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n >> k;
cin >> upute;
cin >> l;
cin >> r;
rj1="1", rj2="1";
for (int i=0; i<n-1; i++){
	if (upute[i]=='L') {rj1+='0'; rj2+='1';}
	else {rj1+='1'; rj2+='0';}
}
if (l<=rj1 and rj1<=r){
	long long sol=0;
	for (int i=0; i<n; i++){
		sol*=2;
		sol+=rj1[i]-'0';
		sol%=mod;
	} ans+=sol;
}
if (l<=rj2 and rj2<=r){
	long long sol=0;
	for (int i=0; i<n; i++){
		sol*=2;
		sol+=rj2[i]-'0';
		sol%=mod;
	} ans+=sol;
}
cout << ans;
return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 4 ms 384 KB Output is correct
7 Incorrect 5 ms 512 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 4 ms 384 KB Output is correct
7 Incorrect 5 ms 512 KB Output isn't correct
8 Halted 0 ms 0 KB -