QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#491811 | #3102. Navigation 2 | Rafi22 | 0 | 1ms | 3768kb | C++20 | 2.6kb | 2024-07-25 22:44:56 | 2024-07-25 22:44:56 |
Judging History
Anna
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif
#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
namespace {
}
void Anna(int n,int K,vector<int>R,vector<int>C)
{
FOR(i,0,n-1)
{
FOR(j,0,n-1)
{
int col=3*(i%3)+j%3;
if(col==8) SetFlag(i,j,1);
else if(col==7) SetFlag(i,j,2);
else
{
if(R[col]<i-1) SetFlag(i,j,2);
else if(R[col]>i+1) SetFlag(i,j,3);
else if(C[col]>j+1) SetFlag(i,j,4);
else if(C[col]<j-1) SetFlag(i,j,5);
else
{
int di=R[col]-i,dj=C[col]-j;
int w=3*(di+1)+(dj+1);
SetFlag(i,j,6+w);
}
}
}
}
}
Bruno
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif
#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
namespace {
} // namespace
vector<int>Bruno(int K,vector<int>value)
{
debug(value);
vector<int>ans(K);
int si,sj;
FOR(k,0,8)
{
if(value[k]==1)
{
si=k/3;
sj=k%3;
}
}
FOR(k,0,8)
{
int i=2-si+k/3;
int j=2-sj+k%3;
int col=3*i+j;
int L=value[k];
if(col<=6)
{
debug(col,k);
if(L==2) ans[col]=3;
else if(L==3) ans[col]=2;
else if(L==4) ans[col]=0;
else if(L==5) ans[col]=1;
else
{
L-=6;
int di=L/3-1;
int dj=L%3-1;
di+=i-1;
dj+=j-1;
debug(di,dj);
if(di<0) ans[col]=3;
else if(di>0) ans[col]=2;
else if(dj<0) ans[col]=1;
else if(dj>0) ans[col]=0;
else ans[col]=4;
}
}
}
debug(ans);
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3768kb
input:
288 7 11 9 5 1 10 2 10 5 9
output:
0 0 0 0 0 0 0
input:
output:
Wrong Answer [7]
result:
wrong answer