# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
744219 |
2023-05-18T09:35:32 Z |
saayan007 |
Mars (APIO22_mars) |
C++17 |
|
1 ms |
220 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';
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "LINE(" << __LINE__ << ") -> " <<"[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
#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 time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
220 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |