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>
#define ff(j, a, b) for(int j=a;j<b;j++)
#define pb push_back;
#define MOD 1000000007
using namespace std;
typedef long long ll;
int n, k;
int 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;
}
}
int bin_string_to_int()
{
int 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_int();
b=bin_string_to_int();
cout << (a%MOD+b%MOD)%MOD;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |