Submission #918828

#TimeUsernameProblemLanguageResultExecution timeMemory
918828ErJSoccer Stadium (IOI23_soccer)C++17
25 / 100
350 ms86864 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<ll> #define vvi vector<vector<ll>> #define vs vector<string> #define vc vector<char> #define vb vector<bool> #define vp vector<pair<ll, ll>> #define pp pair<ll, ll> #define qi queue<ll> #define qp queue<pp> #define pqi priority_queue<ll> #define pqp priority_queue<pp> #define mi map<ll, ll> #define mpi map<pp, ll> #define mip map<ll, pp> #define mpp map<pp, pp> #define mb map<ll, bool> #define si set<ll> #define sp set<pp> #define mod 1000000007 #define rep(a, b) for(int a = 0; a < (b); a++) #define inf 1000000000000000000 bool isOK(int n, vector<vector<int>> F) { vp okraje(n); for (int i = 0; i < n; i++) { int pocet = 0; for (int j = 1; j < n; j++) { if (F[i][j] != F[i][j - 1]) { pocet++; } } if (F[i][n - 1] == 0) pocet++; if (F[i][0] == 0) pocet++; if (pocet > 2) { return 0; } okraje[i] = { -1, -1 }; for (int j = 0; j < n; j++) { if (F[i][j] == 0) { okraje[i].first = j; break; } } for (int j = n - 1; j >= 0; j--) { if (F[i][j] == 0) { okraje[i].second = j; break; } } } for (int i = 0; i < okraje.size(); i++) { for (int j = 0; j < okraje.size(); j++) { if (!(((okraje[i].first <= okraje[j].first) && (okraje[i].second >= okraje[j].second)) || (((okraje[j].first <= okraje[i].first) && (okraje[j].second >= okraje[i].second))))) { if (okraje[i].first != -1 && okraje[j].first != -1) { return 0; } } } } return 1; } int biggest_stadium(int n, vector<vector<int>> F) { vector<vector<int>> FT(n); int ans = 0; for (int i = 0; i < n; i++) { FT[i].resize(n); for (int j = 0; j < n; j++) { if (F[i][j] == 0) ans++; FT[i][j] = F[j][i]; } } if (isOK(n, F) && isOK(n, FT)) { return ans; } else { return 0; } }

Compilation message (stderr)

soccer.cpp: In function 'bool isOK(int, std::vector<std::vector<int> >)':
soccer.cpp:56:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 |  for (int i = 0; i < okraje.size(); i++) {
      |                  ~~^~~~~~~~~~~~~~~
soccer.cpp:57:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |   for (int j = 0; j < okraje.size(); j++) {
      |                   ~~^~~~~~~~~~~~~~~
#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...