Submission #1041484

# Submission time Handle Problem Language Result Execution time Memory
1041484 2024-08-02T04:42:53 Z vjudge1 Ljetopica (COI19_ljetopica) C++17
8 / 100
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007

void solve(){
    ll  n ,k , c1 = 0, c2 = 0;
    cin >> n >> k;
    string a  , b , s;
    cin >> s >> a >> b;
    for(int i = 0 ;i < a.length(); i ++){
        c1 = ((c1 * 2) + (a[i] - '0')) % MOD;
        c2 = ((c2 * 2) + (b[i] - '0')) % MOD;
    }
    if(c1 == c2){
        c1 = 0 ;
    }
    cout << (c1 + c2) % MOD << '\n';
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int tests = 1;
    // cin >> tests;
    for (int i = 1; i <= tests; i++){
        solve();
    }
    return 0;
}

Compilation message

ljetopica.cpp: In function 'void solve()':
ljetopica.cpp:11:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i = 0 ;i < a.length(); i ++){
      |                    ~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Incorrect 1 ms 344 KB Output isn't correct
10 Halted 0 ms 0 KB -