Submission #975398

#TimeUsernameProblemLanguageResultExecution timeMemory
975398vjudge1Hexagonal Territory (APIO21_hexagon)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define nl "\n" const int maxn = 2e5+5; int draw_territory(int N, int A, int B, vector<int> D, vector<int> L){ int mod = 1e9+7; int ans=0; if(N==3){ for (auto i : L){ int length = i; // ans = ((((length*(2*length-1)*(length+1)/6)*B)%mod) + ((length*(length+1))/2 * (A-B))%mod) % mod; ans += (length*(length+1)/2) % mod; } } else{ int totalsq = 4000*4000; int dx[6] = {0, 1, 1, 0, -1, -1}; int dy[6] = {2, 1 ,-1, -2, -1, 1}; } return ans; }

Compilation message (stderr)

hexagon.cpp: In function 'int draw_territory(int, int, int, std::vector<int>, std::vector<int>)':
hexagon.cpp:19:13: warning: unused variable 'totalsq' [-Wunused-variable]
   19 |         int totalsq = 4000*4000;
      |             ^~~~~~~
hexagon.cpp:20:13: warning: unused variable 'dx' [-Wunused-variable]
   20 |         int dx[6] = {0, 1, 1, 0, -1, -1};
      |             ^~
hexagon.cpp:21:13: warning: unused variable 'dy' [-Wunused-variable]
   21 |         int dy[6] = {2, 1 ,-1, -2, -1, 1};
      |             ^~
#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...