Submission #861185

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8611852023-10-15 15:18:20GordonRemzi007Soccer Stadium (IOI23_soccer)C++17
0 / 100
4518 ms348 KiB
#include <iostream>
#include <vector>
using namespace std;
int biggest_stadium(int n, vector<vector<int>> a) {
int res = 1, temp, down, up;
bool ok, can1, can2;
vector<pair<int,int>> free;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
if(!a[i][j]) free.push_back({i, j});
}
}
for(int i = 2; i < (1<<free.size()); i++) {
temp = i;
vector<int> tempfree;
for(int i = 0; i < free.size() && temp > 0; i++, temp/=2) {
if(temp%2==0) tempfree.push_back(i);
}
ok = true;
for(int i = 0; i < tempfree.size(); i++) {
for(int j = 0; j < tempfree.size(); j++) {
if(free[tempfree[i]].first < free[tempfree[j]].first) {
down = tempfree[i];
up = tempfree[j];
} else {
down = tempfree[j];
up = tempfree[i];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:18:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |         for(int i = 0; i < free.size() && temp > 0; i++, temp/=2) {
      |                        ~~^~~~~~~~~~~~~
soccer.cpp:22:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         for(int i = 0; i < tempfree.size(); i++) {
      |                        ~~^~~~~~~~~~~~~~~~~
soccer.cpp:23:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |             for(int j = 0; j < tempfree.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...