Submission #361867

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3618672021-01-31 18:58:59idk321Parachute rings (IOI12_rings)C++11
0 / 100
3 ms1772 KiB
#include <vector>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
typedef long long ll;
const int N = 5005;
const int X = 3;
bool all = true;
bool bad = false;
bool bad2[X];
vector<int> big3;
vector<int> adj[X][N];
int p[X][N];
//int r[3][N];
bool second = false;
int n;
int getR(int x, int a)
{
if (p[x][a] == a)return a;
p[x][a] = getR(x, p[x][a]);
return p[x][a];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

rings.cpp: In function 'void Link(int, int)':
rings.cpp:169:33: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  169 |                 if (big3.size() < l)
      |                     ~~~~~~~~~~~~^~~
rings.cpp: In function 'int CountCritical()':
rings.cpp:203:47: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
  203 |     for (int i = 1; i<= 3; i++) res += !bad2[i];
      |                                         ~~~~~~^
rings.cpp:203:22: note: within this loop
  203 |     for (int i = 1; i<= 3; i++) res += !bad2[i];
      |                     ~^~~~
rings.cpp:203:47: warning: array subscript 3 is above array bounds of 'bool [3]' [-Warray-bounds]
  203 |     for (int i = 1; i<= 3; i++) res += !bad2[i];
      |                                         ~~~~~~^
rings.cpp:15:6: note: while referencing 'bad2'
   15 | bool bad2[X];
      |      ^~~~
#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...