Submission #731591

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7315912023-04-27 15:19:47ogibogi2004Mars (APIO22_mars)C++17
36 / 100
255 ms3172 KiB
#include "mars.h"
#include<bits/stdc++.h>
using namespace std;
vector<vector<bool> > read_string(string s,int k)
{
//it should have k+2 * k+2
//i,j in (k+2)*i+j
vector<vector<bool> >ret;
for(int i=0;i<k+1;i++)
{
ret.push_back({});
for(int j=0;j<k+1;j++)
{
ret[i].push_back(s[(k+1)*i+j]);
}
}
//cout<<"?\n";
for(int i=0;i<(k+1)*(k+1);i++)
{
int x=i/(k+1);
int y=i%(k+1);
//cout<<x<<" "<<y<<endl;
ret[x][y]=s[i]-'0';
}
return ret;
}
string encode(vector<vector<bool> >v)
{
string ret="";
int t=v.size()/2+1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

mars.cpp: In function 'std::string encode(std::vector<std::vector<bool> >)':
mars.cpp:32:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     for(int i=0;i<v.size();i+=2)
      |                 ~^~~~~~~~~
mars.cpp:34:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |         for(int j=0;j<v.size();j+=2)
      |                     ~^~~~~~~~~
mars.cpp: In function 'void dfs(int, int)':
mars.cpp:49:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |     if(x+1<matrix.size()&&vis[x+1][y]==0&&matrix[x+1][y]==1)dfs(x+1,y);
      |        ~~~^~~~~~~~~~~~~~
mars.cpp:50:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |     if(y+1<matrix.size()&&vis[x][y+1]==0&&matrix[x][y+1]==1)dfs(x,y+1);
      |        ~~~^~~~~~~~~~~~~~
mars.cpp: In function 'std::string get_num_islands(std::vector<std::vector<bool> >)':
mars.cpp:64:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   64 |     for(int i=0;i<v.size();i++)
      |                 ~^~~~~~~~~
mars.cpp:66:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   66 |         for(int j=0;j<v[i].size();j++)
      |                     ~^~~~~~~~~~~~
mars.cpp: In function 'std::string process(std::vector<std::vector<std::__cxx11::basic_string<char> > >, int, int, int, int)':
mars.cpp:115:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  115 |                 for(int dx=0;dx<subtable.size()&&i1+dx*2<actual_table.size();dx++)
      |                              ~~^~~~~~~~~~~~~~~~
mars.cpp:115:57: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  115 |                 for(int dx=0;dx<subtable.size()&&i1+dx*2<actual_table.size();dx++)
      |                                                  ~~~~~~~^~~~~~~~~~~~~~~~~~~~
mars.cpp:117:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  117 |                     for(int dy=0;dy<subtable[dx].size()&&i2+dy*2<actual_table.size();dy++)
      |                                  ~~^~~~~~~~~~~~~~~~~~~~
mars.cpp:117:65: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  117 |                     for(int dy=0;dy<subtable[dx].size()&&i2+dy*2<actual_table.size();dy++)
      |                                                          ~~~~~~~^~~~~~~~~~~~~~~~~~~~
mars.cpp:148:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  148 |                 for(int dx=0;dx<subtable.size()&&i1+dx*2<actual_table.size();dx++)
      |                              ~~^~~~~~~~~~~~~~~~
mars.cpp:148:57: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  148 |                 for(int dx=0;dx<subtable.size()&&i1+dx*2<actual_table.size();dx++)
      |                                                  ~~~~~~~^~~~~~~~~~~~~~~~~~~~
mars.cpp:150:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  150 |                     for(int dy=0;dy<subtable[dx].size()&&i2+dy*2<actual_table.size();dy++)
      |                                  ~~^~~~~~~~~~~~~~~~~~~~
mars.cpp:150:65: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  150 |                     for(int dy=0;dy<subtable[dx].size()&&i2+dy*2<actual_table.size();dy++)
      |                                                          ~~~~~~~^~~~~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...