Submission #1056909

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10569092024-08-13 12:19:29NickpapadakGame (eJOI20_game)C++14
0 / 100
0 ms348 KiB
#include<bits/stdc++.h>
using namespace std;
const unsigned int MAXN = (int)2e+1 + 5;
const unsigned int MAXMN = 410;
int grid[MAXN][MAXN];
int N, M;
int cnt;
int p[MAXMN];
int sz[MAXMN];
int CI(int x, int y) {return (y-1)*M + x;}
int findp(int u){
if(p[u] == u) return u;
return p[u] = findp(p[u]);
}
void Union(int u, int v){
if(findp(v) == findp(u)) return;
if(sz[findp(v)] > sz[findp(u)]) swap(u,v);
sz[findp(u)] += sz[findp(v)];
// int x = findp(u), y = findp(v);
// printf("%d\n", findp(v));
// p[2]= 1;
p[findp(v)] = findp(u);
}
void Join(int x, int y, int dx, int dy){
// printf("\n\n%d %d\n\n", x, y);
if(x < 1 || x > M || y < 0 || y > N) return;
if(dx < 1 || dx > M || dy < 0 || dy > N) return;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

game.cpp: In function 'int main()':
game.cpp:35:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |     scanf("%d%d", &N, &M);
      |     ~~~~~^~~~~~~~~~~~~~~~
game.cpp:41:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |     scanf("%s", ps);
      |     ~~~~~^~~~~~~~~~
game.cpp:44:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   44 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~
game.cpp:56:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   56 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~
#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...