제출 #1237519

#제출 시각아이디문제언어결과실행 시간메모리
1237519bangan모자이크 (IOI24_mosaic)C++20
8 / 100
110 ms37892 KiB
#include "mosaic.h" #include <bits/stdc++.h> #include <vector> using namespace std; #define ll long long std::vector<long long> mosaic(std::vector<int> X, std::vector<int> Y, std::vector<int> T, std::vector<int> B, std::vector<int> L, std::vector<int> R) { int N = X.size(); int Q = (int)T.size(); // vector a(1, vector<ll>(N)); // for (int i=0; i<N; i++) a[0][i] = X[i]; // for (int i=0; i<1; i++) a[i][0] = Y[i]; // for (int i=1; i<1; i++) for (int j=1; j<N; j++) a[i][j] = (a[i][j-1] | a[i-1][j]) ^ 1; // for (int i=0; i<1; i++) for (int j=0; j<N; j++) { // if (0 <= i-1) a[i][j] += a[i-1][j]; // if (0 <= j-1) a[i][j] += a[i][j-1]; // if (0 <= i-1 && 0 <= j-1) a[i][j] -= a[i-1][j-1]; // } if (accumulate(X.begin()+1, X.end(), 0)==0 && accumulate(Y.begin()+1, Y.end(), 0)==0) { std::vector<long long> C(Q, 0); for (int i=0; i<Q; i++) { int r1=T[i], r2=B[i]; int c1=L[i], c2=R[i]; if (!r1&&!r2) { C[i]=0; continue; } if (!c1&&!c2) { C[i]=0; continue; } if (!r1) r1++; if (!c1) c1++; int r = r2-r1+1; r/=2; int c = c2-c1+1; c/=2; r += (r1%2==1 && r2%2==1); c += (c1%2==1 && c2%2==1); C[i] = 1ll*r*c; r = (r2-r1+1) - r; c = (c2-c1+1) - c; C[i] += 1ll*r*c; } return C; } vector<map<int, int>> a(N); for (int r=0; r<N; r++) a[r][0] = Y[r]; for (int c=0; c<N; c++) a[0][c] = X[c]; }

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

mosaic.cpp: In function 'std::vector<long long int> mosaic(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
mosaic.cpp:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...