Submission #744298

# Submission time Handle Problem Language Result Execution time Memory
744298 2023-05-18T10:53:39 Z saayan007 Mars (APIO22_mars) C++17
0 / 100
1 ms 200 KB
#include "bits/stdc++.h"
using namespace std;

/* #define int long long */
#define fr first
#define sc second
#define eb emplace_back
const char nl = '\n';
#include "mars.h"

string conToStr(int x) {
    string res;
    for(int i = 0; i < 100; ++i) {
        if(x % 2) res.push_back('1');
        else res.push_back('0');
        x /= 2;
    }
    return res;
}

int conToInt(string x) {
    int res = 0;
    for(int i = 99; i >= 0; --i) {
        res *= 2;
        if(x[i] == '1') res = res + 1;
    }
    return res;
}

string process(vector <vector<string>> a, int i, int j, int k, int n)
{
    int res = 0;
    if(n == 2) {
        if(k == 0) {
            for(int di = 0; di < 3; ++di) {
                for(int dj = 0; dj < 3; ++dj) {
                    int x = i + di, y = j + dj;
                    int add = 0;
                    if(a[di][dj][0] == '1') ++add;
                    int mi = (x > 2 ? 5 - x : x + 1);
                    int mj = (y > 2 ? 5 - y : y + 1);
                    res += add * 36 / (mi * mj);
                }
            }
            return conToStr(res);
        }
        else {
            for(int di = 0; di < 3; ++di) {
                for(int dj = 0; dj < 3; ++dj) {
                    res += conToInt(a[di][dj]);
                }
            }
            res /= 36;
            return conToStr(res);
        }
    }
    else {
        for(int di = 0; di < 3; ++di) {
            for(int dj = 0; dj < 3; ++dj) {
                res += conToInt(a[di][dj]);
            }
        }
        return conToStr(res);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Incorrect
2 Halted 0 ms 0 KB -