Submission #1099881

#TimeUsernameProblemLanguageResultExecution timeMemory
1099881model_codeMosaic (IOI24_mosaic)C++17
8 / 100
108 ms15088 KiB
// incorrect/subtask5.cpp #include "mosaic.h" #include "bits/stdc++.h" using namespace std; vector<long long> mosaic(vector<int> X, vector<int> Y, vector<int> T, vector<int> B, vector<int> L, vector<int> R) { vector<long long> ans; for(int i = 0; i < T.size(); i++) { int rx = T[i], ry = B[i]; int cx = L[i], cy = R[i]; rx = max(rx, 1); cx = max(cx, 1); if(rx <= ry && cx <= cy) { long long area = 1ll*(ry-rx+1)*(cy-cx+1); ans.push_back((area+((rx+cx)&1^1)) / 2); } else ans.push_back(0); } 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:9:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for(int i = 0; i < T.size(); i++) {
      |                    ~~^~~~~~~~~~
mosaic.cpp:16:41: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   16 |             ans.push_back((area+((rx+cx)&1^1)) / 2);
      |                                  ~~~~~~~^~
#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...