# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
893758 | danikoynov | Navigation 2 (JOI21_navigation2) | C++17 | 0 ms | 332 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Anna.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
namespace
{
int FunctionExample(int r, int c, int K)
{
return (r + c) % K + 1;
}
} // namespace
const int maxn = 310;
int value[maxn][maxn];
void Anna(int N, int K, std::vector<int> R, std::vector<int> C)
{
for (int i = 0; i < K; i ++)
{
for (int x = 0; x < R[i]; x ++)
for (int y = 0; y < N; y ++)
{
value[x][y] |= (1 << i);
}
for (int y = C[i] - 1; y >= 0; y -= 2)
{
value[R[i]][y] |= (1 << i);
}
value[R[i]][C[i]] |= (1 << i);
}
for (int i = 0; i < N; i ++)
for (int j = 0; j < N; j ++)
SetFlag(i, j, value[i][j] + 1);
/**for (int i = 0; i < N; i ++, cout << endl)
for (int j = 0; j < N; j ++)
cout << value[i][j] << " ";
cout << endl;*/
}
#include "Bruno.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
namespace
{
int variable_example = 1;
} // namespace
std::vector<int> Bruno(int K, std::vector<int> value)
{
///cout << "BRUNO" << endl;
for (int i = 0; i < 9; i ++)
value[i] --;
vector < int > res;
for (int i = 0; i < K; i ++)
{
///cout << "step " << i << endl;
int var[9];
for (int j = 0; j < 9; j ++)
var[j] = (value[j] & (1 << i));
/**for (int j = 0; j < 9; j ++)
cout << var[j] << " ";
cout << endl;*/
if (var[3] && var[4] && var[5])
{
res.push_back(2);
continue;
}
if (!var[3] && !var[4] && !var[5])
{
res.push_back(3);
continue;
}
if (var[4])
{
if (var[3])
{
res.push_back(4);
continue;
}
res.push_back(0);
}
else
{
if (var[4])
res.push_back(1);
else
res.push_back(0);
}
}
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |