Submission #845269

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8452692023-09-06 12:54:54simona1230T-Covering (eJOI19_covering)C++17
70 / 100
1029 ms79052 KiB
#include <bits/stdc++.h>
using namespace std;
vector<short int> a[1000000];
vector<int> used[1000000];
int n,m,k;
struct edge
{
short int x,y;
edge(){}
edge(short int _x,short int _y)
{
x=_x;
y=_y;
}
edge operator+(edge e)
{
return {e.x+x,e.y+y};
}
};
edge pos[4]={{-1,0},{1,0},{0,-1},{0,1}};
edge p[1000000];
vector<int> v[1000000];
bool in_range(edge p)
{
return p.x>=0&&p.x<n&&p.y>=0&&p.y<m;
}
void read()
{
cin>>n>>m;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

covering.cpp: In member function 'edge edge::operator+(edge)':
covering.cpp:18:20: warning: narrowing conversion of '(((int)e.edge::x) + ((int)((edge*)this)->edge::x))' from 'int' to 'short int' [-Wnarrowing]
   18 |         return {e.x+x,e.y+y};
      |                 ~~~^~
covering.cpp:18:26: warning: narrowing conversion of '(((int)e.edge::y) + ((int)((edge*)this)->edge::y))' from 'int' to 'short int' [-Wnarrowing]
   18 |         return {e.x+x,e.y+y};
      |                       ~~~^~
covering.cpp: In function 'void read()':
covering.cpp:50:24: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   50 |                 if(x==0&&y==0||x==2&&y!=0||x==-2&&y!=0||y==2&&x!=0||y==-2&&x!=0)continue;
      |                    ~~~~^~~~~~
covering.cpp:50:49: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   50 |                 if(x==0&&y==0||x==2&&y!=0||x==-2&&y!=0||y==2&&x!=0||y==-2&&x!=0)continue;
      |                                            ~~~~~^~~~~~
covering.cpp:50:61: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   50 |                 if(x==0&&y==0||x==2&&y!=0||x==-2&&y!=0||y==2&&x!=0||y==-2&&x!=0)continue;
      |                                                         ~~~~^~~~~~
covering.cpp:50:74: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   50 |                 if(x==0&&y==0||x==2&&y!=0||x==-2&&y!=0||y==2&&x!=0||y==-2&&x!=0)continue;
      |                                                                     ~~~~~^~~~~~
covering.cpp:51:32: warning: narrowing conversion of '(((int)p[((int)i)].edge::x) + x)' from 'int' to 'short int' [-Wnarrowing]
   51 |                 edge nb={p[i].x+x,p[i].y+y};
      |                          ~~~~~~^~
covering.cpp:51:41: warning: narrowing conversion of '(((int)p[((int)i)].edge::y) + y)' from 'int' to 'short int' [-Wnarrowing]
   51 |                 edge nb={p[i].x+x,p[i].y+y};
      |                                   ~~~~~~^~
covering.cpp: In function 'void dfs(int)':
covering.cpp:86:24: warning: comparison of integer expressions of different signedness: 'short int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |     for(short int i=0;i<v[num].size();i++)
      |                       ~^~~~~~~~~~~~~~
#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...