Submission #1170640

#TimeUsernameProblemLanguageResultExecution timeMemory
1170640AbdullahIshfaqMosaic (IOI24_mosaic)C++20
Compilation error
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;

Compilation message (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;
      |     ^~~~~~