Submission #975194

#TimeUsernameProblemLanguageResultExecution timeMemory
975194yoav_sHexagonal Territory (APIO21_hexagon)C++17
0 / 100
1 ms436 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> v; typedef vector<v> vv; typedef vector<vv> vvv; typedef pair<ll, ll> p; typedef vector<p> vp; typedef vector<vp> vvp; typedef vector<vvp> vvvp; typedef pair<ll, p> tri; typedef vector<tri> vtri; typedef vector<vtri> vvtri; typedef vector<vvtri> vvvtri; typedef vector<bool> vb; typedef vector<vb> vvb; typedef vector<vvb> vvvb; #define f first #define s second #define pb push_back #define eb emplace_back #define all(v) (v).begin(),(v).end() const ll INF = 1e18; const ll mod = 1e9 + 7; #include "hexagon.h" struct Hex { ll a, b, c; Hex() {a = 0; b = 0; c = 0;} Hex(ll a, ll b, ll c) : a(a), b(b), c(c) {} Hex operator+(Hex other) { return Hex(a + other.a, b + other.b, c + other.c); } Hex operator+=(Hex other) { a += other.a; b += other.b; c += other.c; } Hex operator-(Hex other) { return Hex(a - other.a, b - other.b, c - other.c); } Hex operator-=(Hex other) { a -= other.a; b -= other.b; c -= other.c; } Hex operator-() { return Hex() - *this; } }; int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L) { ll count = ((L[0] + 1) * (L[0] + 2)) / 2; count %= mod; return (A * count) % mod; } /* int main() { int N, A, B; assert(3 == scanf("%d %d %d", &N, &A, &B)); std::vector<int> D(N), L(N); for (int i = 0; i < N; ++i) { assert(2 == scanf("%d %d", &D[i], &L[i])); } int result = draw_territory(N, A, B, D, L); printf("%d\n", result); return 0; } /**/

Compilation message (stderr)

hexagon.cpp:77:1: warning: "/*" within comment [-Wcomment]
   77 | /**/
      |  
hexagon.cpp: In member function 'Hex Hex::operator+=(Hex)':
hexagon.cpp:44:5: warning: no return statement in function returning non-void [-Wreturn-type]
   44 |     }
      |     ^
hexagon.cpp: In member function 'Hex Hex::operator-=(Hex)':
hexagon.cpp:52:5: warning: no return statement in function returning non-void [-Wreturn-type]
   52 |     }
      |     ^
#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...