제출 #1170640

#제출 시각아이디문제언어결과실행 시간메모리
1170640AbdullahIshfaq모자이크 (IOI24_mosaic)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 ll sum(ll x,ll y){ if(x < 0 or y < 0){ return 0; } return ((x * y) + 1) / 2; } 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){ vector<ll> ans; for(int i = 0; i < T.size(); i ++){ ll x1 = T[i], y1 = L[i], x2 = B[i], y2 = R[i]; ans.push_back(sum(x2,y2) - sum(x2, y1 - 1) - (x1 - 1, y2) + (x1 - 1, y1 - 1)); } } return ans;

컴파일 시 표준 에러 (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:20:5: warning: no return statement in function returning non-void [-Wreturn-type]
   20 |     }
      |     ^
mosaic.cpp: At global scope:
mosaic.cpp:21:5: error: expected unqualified-id before 'return'
   21 |     return ans;
      |     ^~~~~~