Submission #444823

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4448232021-07-15 13:54:53raidT-Covering (eJOI19_covering)C++17
100 / 100
366 ms22164 KiB
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int n, m, k;
bool out( int i, int j ) {
return i < 1 || i > n || j < 1 || j > m;
}
int dx[12] = { -1, 0, 1, 0, 1, -1, -1, 1, -2, 0, 2, 0 };
int dy[12] = { 0, -1, 0, 1, 1, 1, -1, -1, 0, -2, 0, 2 };
int dxv[4] = { -1, 0, 1, 0 };
int dyv[4] = { 0, 1, 0, -1 };
vector<pair<int, int>> cell;
vector<int> winn;
vector<vector<int>> viz;
vector<vector<int>> w, t;
void dfs( int x, int y ) {
cell.push_back({ x, y });
viz[x][y] = 1;
for ( int dir = 0; dir < 12; ++dir ) {
int nx = x + dx[dir], ny = y + dy[dir];
if ( !out( nx, ny ) && !viz[nx][ny] && t[nx][ny] ) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

covering.cpp: In function 'int maxWin()':
covering.cpp:39:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |   for ( int i = 0; i < cell.size(); ++i ) {
      |                    ~~^~~~~~~~~~~~~
covering.cpp:56:24: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   56 |   if ( 4 * cell.size() > ngh ) {
      |        ~~~~~~~~~~~~~~~~^~~~~
#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...