Submission #129803

# Submission time Handle Problem Language Result Execution time Memory
129803 2019-07-13T09:18:27 Z pzdba Ljetopica (COI19_ljetopica) C++14
0 / 100
2 ms 376 KB
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
char s[1002], a[1002], b[1002];
int main(){
    int n, k;
    scanf("%d%d", &n, &k);
    scanf("%s", s+1);    
    scanf("%s", a+1);
    scanf("%s", b+1);

    int ans = 0, res = 0;
    for(int i=1;i<=n;i++){
        res = (res*2 + a[i]-'0')%mod;
    }
    ans = (ans + res)%mod;
    res = 0;
    for(int i=1;i<=n;i++){
        res = (res*2 + b[i]-'0')%mod;
    }
    ans = (ans + res)%mod;
    printf("%d\n", ans);
}

Compilation message

ljetopica.cpp: In function 'int main()':
ljetopica.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &k);
     ~~~~~^~~~~~~~~~~~~~~~
ljetopica.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", s+1);    
     ~~~~~^~~~~~~~~~~
ljetopica.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", a+1);
     ~~~~~^~~~~~~~~~~
ljetopica.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", b+1);
     ~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -