Submission #421613

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4216132021-06-09 10:01:13tinjyuHexagonal Territory (APIO21_hexagon)C++14
12 / 100
13 ms2980 KiB
#include "hexagon.h"
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
long long int n,a,b,d[1000005],l[1000005],x[1000005],y[1000005];
int draw_territory(int N, int A, int B,std::vector<int> D, std::vector<int> L) {
n=N;
a=A;
b=B;
long long int p=0;
for(int i=0;i<n;i++)
{
d[i]=D[i];
l[i]=L[i];
p+=l[i];
}
long long int nowx=0,nowy=0;
long long int cnt=1;
for(int i=0;i<n;i++)
{
if(d[i]==1)nowy+=l[i];
if(d[i]==2)nowy+=l[i],nowx+=l[i];
if(d[i]==3)nowx+=l[i];
if(d[i]==4)nowy-=l[i];
if(d[i]==5)nowy-=l[i],nowx-=l[i];
if(d[i]==6)nowx-=l[i];
x[cnt]=nowx;
y[cnt]=nowy;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...