제출 #411378

#제출 시각아이디문제언어결과실행 시간메모리
411378ismoilovVision Program (IOI19_vision)C++14
33 / 100
6 ms1056 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); //#define int ll #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++) #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++) #define fv(a, c) for(int (a) = (1); (a) <= (c); (a)++) #define fz(a, c) for(int (a) = (0); (a) < (c); (a)++) #define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--) #define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--) #define pb push_back #define in insert #define ss second #define ff first #define vi vector <int> #define fa(a, v) for(auto (a) : (v)) #define mnel(a) *min_element(all(a)) #define mxel(a) *max_element(all(a)) #define si set<int> #define sov(a) sort(all((a))) void construct_network(int h, int w, int K) { vector<int> ss; if(K == 1){ fp(i,0,h){ fp(j,0,w){ int x = i*w+j; vi n; fpp(k,-1,1){ int i1 = i + k, j1 = j + (abs(k) - K); int i2 = i + k, j2 = j - (abs(k) - K); if(i1 >= 0 && i1 < h && j1 >= 0 && j1 < w) n.pb(i1*w + j1); if(i2 >= 0 && i2 < h && j2 >= 0 && j2 < w) n.pb(i2*w + j2); } ss.pb(add_and({x, add_or(n)})); } } } if(max(h, w) > 10 && min(h, w) != 1){ int i = 0, j = 0; int x = i*w + j; fpp(k,-K, K){ int ii = i + k, jj = j + (abs(k) - K); if(ii >= 0 && ii < h && jj >= 0 && jj < w) ss.pb(add_and({x, ii*w +jj})); ii = i + k, jj = j - (abs(k) - K); if(ii >= 0 && ii < h && jj >= 0 && jj < w) ss.pb(add_and({x, ii*w +jj})); } } else{ fp(i,0,h){ fp(j,0,w){ int x = i*w + j; fpp(k,-K, K){ int ii = i + k, jj = j + (abs(k) - K); if(ii >= 0 && ii < h && jj >= 0 && jj < w) ss.pb(add_and({x, ii*w +jj})); ii = i + k, jj = j - (abs(k) - K); if(ii >= 0 && ii < h && jj >= 0 && jj < w) ss.pb(add_and({x, ii*w +jj})); } } } } add_or(ss); }

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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:14:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   14 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
vision.cpp:33:3: note: in expansion of macro 'fp'
   33 |   fp(i,0,h){
      |   ^~
vision.cpp:14:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   14 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
vision.cpp:34:4: note: in expansion of macro 'fp'
   34 |    fp(j,0,w){
      |    ^~
vision.cpp:15:28: warning: unnecessary parentheses in declaration of 'k' [-Wparentheses]
   15 | #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
      |                            ^
vision.cpp:37:5: note: in expansion of macro 'fpp'
   37 |     fpp(k,-1,1){
      |     ^~~
vision.cpp:15:28: warning: unnecessary parentheses in declaration of 'k' [-Wparentheses]
   15 | #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
      |                            ^
vision.cpp:52:4: note: in expansion of macro 'fpp'
   52 |    fpp(k,-K, K){
      |    ^~~
vision.cpp:14:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   14 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
vision.cpp:62:3: note: in expansion of macro 'fp'
   62 |   fp(i,0,h){
      |   ^~
vision.cpp:14:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   14 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
vision.cpp:63:4: note: in expansion of macro 'fp'
   63 |    fp(j,0,w){
      |    ^~
vision.cpp:15:28: warning: unnecessary parentheses in declaration of 'k' [-Wparentheses]
   15 | #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++)
      |                            ^
vision.cpp:65:5: note: in expansion of macro 'fpp'
   65 |     fpp(k,-K, K){
      |     ^~~
#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...