# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1041621 | vjudge1 | Ljetopica (COI19_ljetopica) | C++17 | 1 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int mod = 1'000'000'007;
int N, K;
string s, a, b;
bool small(string a, string b)
{
for(int i = 0; i < a.size(); i++)
if(a[i] != b[i])
return a[i] < b[i];
return false;
}
int val(string s)
{
int hsh = 0;
for(char i : s)
hsh = (hsh * 2ll + (i - '0')) % mod;
return hsh;
}
void subtask1()
{
string ans1 = "1", ans2 = "1";
for(char i : s)
{
if(i == 'L')
ans1 += '0', ans2 += '1';
else
ans1 += '1', ans2 += '0';
}
int ans = 0;
if(!small(ans1, a) && !small(b, ans1))
ans = (ans + val(ans1)) % mod;
if(!small(ans2, a) && !small(b, ans2))
ans = (ans + val(ans2)) % mod;
cout << ans << endl;
exit(0);
}
void subtask2()
{
}
int main()
{
cin >> N >> K >> s >> a >> b;
if(K == 0)
subtask1();
subtask2();
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |