Submission #744223

#TimeUsernameProblemLanguageResultExecution timeMemory
744223saayan007Mars (APIO22_mars)C++17
0 / 100
1 ms200 KiB
#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 && 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]); } } if(n == 2) res /= 36; return conToStr(res); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...