제출 #980565

#제출 시각아이디문제언어결과실행 시간메모리
980565fcmalkcin육각형 영역 (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" #define ll long long const int maxn = 2e5+5; const ll mod = 1e9+7; ll mul(ll a, ll n) { if (n == 0) return 1; ll t= mul(a, n / 2); if (n%2==0) return (t*t)%mod; else return ((t*t)%mod*a)%mod; } int draw_territory(int N, int A, int B, vector<int> D, vector<int> L){ long long a; if(N==3){ long long length = L[0]; a = ((length * (length-1))%mod*mul(2, mod - 2)) %mod; a = (a * A) %mod; } else{ int totalsq = 4000*4000; int dx[6] = {0, 1, 1, 0, -1, -1}; int dy[6] = {2, 1 ,-1, -2, -1, 1}; } int ans = a%mod; return ans; }

컴파일 시 표준 에러 (stderr) 메시지

hexagon.cpp: In function 'int draw_territory(int, int, int, std::vector<int>, std::vector<int>)':
hexagon.cpp:26:13: warning: unused variable 'totalsq' [-Wunused-variable]
   26 |         int totalsq = 4000*4000;
      |             ^~~~~~~
hexagon.cpp:27:13: warning: unused variable 'dx' [-Wunused-variable]
   27 |         int dx[6] = {0, 1, 1, 0, -1, -1};
      |             ^~
hexagon.cpp:28:13: warning: unused variable 'dy' [-Wunused-variable]
   28 |         int dy[6] = {2, 1 ,-1, -2, -1, 1};
      |             ^~
hexagon.cpp:30:9: warning: 'a' may be used uninitialized in this function [-Wmaybe-uninitialized]
   30 |     int ans = a%mod;
      |         ^~~
#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...