Submission #1056674

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10566742024-08-13 10:34:00NickpapadakT-Covering (eJOI19_covering)C++14
100 / 100
108 ms53700 KiB
#include<bits/stdc++.h>
using namespace std;
#define XX first
#define YY second
const unsigned int MAXK = 1e+6 + 10;
const unsigned int MAXMN = 1e+6 + 10;
const unsigned int INF = 1e+7 + 10;
vector<vector<int> > grid;
vector<vector<bool> > sgrid;
vector<pair<int,int> > special;
vector<vector<int> > adj(MAXMN, vector<int>());
int N,M, K;
int firsSub(){
int ans = 0;
// totalinc = 0/;
for(int i = 0; i<K; ++i){
int c = 0;
int x = special[i].XX, y = special[i].YY;
int u = 0,r=0,l=0,d=0;
r += grid[x+1][y];
r += grid[x][y+1];
r += grid[x][y-1];
l += grid[x-1][y];
l += grid[x][y+1];
l += grid[x][y-1];
d += grid[x-1][y];
d += grid[x+1][y];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

covering.cpp: In function 'int Rleft(int, std::vector<std::vector<bool> >, int)':
covering.cpp:72:27: warning: unused variable 'r' [-Wunused-variable]
   72 |     int u = y+1, d = y-1, r = x+1, l = x-1;
      |                           ^
covering.cpp: In function 'int Rright(int, std::vector<std::vector<bool> >, int)':
covering.cpp:86:36: warning: unused variable 'l' [-Wunused-variable]
   86 |     int u = y+1, d = y-1, r = x+1, l = x-1;
      |                                    ^
covering.cpp: In function 'int Rup(int, std::vector<std::vector<bool> >, int)':
covering.cpp:100:18: warning: unused variable 'd' [-Wunused-variable]
  100 |     int u = y+1, d = y-1, r = x+1, l = x-1;
      |                  ^
covering.cpp: In function 'int Rdown(int, std::vector<std::vector<bool> >, int)':
covering.cpp:114:9: warning: unused variable 'u' [-Wunused-variable]
  114 |     int u = y+1, d = y-1, r = x+1, l = x-1;
      |         ^
covering.cpp: In function 'int main()':
covering.cpp:261:10: warning: variable 'allOneLine' set but not used [-Wunused-but-set-variable]
  261 |     bool allOneLine = 1;
      |          ^~~~~~~~~~
covering.cpp:235:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  235 |     scanf("%d%d", &N,&M);// N = y M = x
      |     ~~~~~^~~~~~~~~~~~~~~
covering.cpp:240:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  240 |             scanf("%d", &grid[x][y]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~~
covering.cpp:252:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  252 |     scanf("%d", &K);
      |     ~~~~~^~~~~~~~~~
covering.cpp:264:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  264 |         scanf("%d%d", &a,&b);
      |         ~~~~~^~~~~~~~~~~~~~~
#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...