Submission #836869

# Submission time Handle Problem Language Result Execution time Memory
836869 2023-08-24T16:29:59 Z Andrey Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
27 / 100
2378 ms 24108 KB
#include<bits/stdc++.h>
using namespace std;

int encode (int n, int x, int y) {
    for(int i = 0; i < 10; i++) {
        if((x&(1 << i)) != (y&(1 << i))) {
            int ans = i+1;
            if(x&(1 << i)) {
                ans+=10;
            }
            return ans;
        }
    }
}
#include<bits/stdc++.h>
using namespace std;

int decode (int n, int q, int h) {
    h--;
    int a = (q&(1 << (h%10)))/(1 << (h%10));
    int b = h/10;
    if((a^b) == 0) {
        return 1;
    }
    else {
        return 0;
    }
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
# Verdict Execution time Memory Grader output
1 Partially correct 2360 ms 24108 KB Output is partially correct - maxh = 20
2 Partially correct 2378 ms 24100 KB Output is partially correct - maxh = 20