#include <bits/stdc++.h>
#define ff(j, a, b) for(long long j=a;j<b;j++)
#define pb push_back;
#define MOD 1000000007
using namespace std;
typedef long long ll;
ll n, k;
ll a, b, path;
void load_path()
{
path=1;
ff(j, 0, n-1)
{
char tmp;
cin >> tmp;
path=path*2;
if(tmp=='R')
{
path++;
}
path=path%MOD;
}
}
ll bin_string_to_ll()
{
ll res=0;
ff(j, 0, n)
{
char c;
cin >> c;
res=res*2;
if(c=='1')
{
res++;
}
res=res%MOD;
}
return res;
}
int main()
{
cin >> n >> k;
load_path();
a=bin_string_to_ll();
b=bin_string_to_ll();
cout << (a%MOD+b%MOD)%MOD;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |