제출 #915853

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9158532024-01-24 19:16:51AlcabelPrize (CEOI22_prize)C++17
54 / 100
3610 ms397052 KiB
#pragma GCC optimize("O3", "Ofast")
#pragma GCC optimize("avx", "avx2")
#include <bits/stdc++.h>
using namespace std;
struct DSU {
int n;
vector<int> par;
DSU() {}
DSU(int _n) {
n = _n;
par.resize(n);
clear();
}
void clear() {
for (int i = 0; i < n; ++i) {
par[i] = i;
}
}
int getParent(int v) {
if (par[v] != v) {
par[v] = getParent(par[v]);
}
return par[v];
}
void uniteSets(int v, int u) {
v = getParent(v), u = getParent(u);
if (v == u) {
return;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp:2:35: warning: bad option '-favx' to pragma 'optimize' [-Wpragmas]
    2 | #pragma GCC optimize("avx", "avx2")
      |                                   ^
Main.cpp:2:35: warning: bad option '-favx2' to pragma 'optimize' [-Wpragmas]
Main.cpp:9:9: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
    9 |     DSU() {}
      |         ^
Main.cpp:9:9: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:10:15: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   10 |     DSU(int _n) {
      |               ^
Main.cpp:10:15: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:15:16: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   15 |     void clear() {
      |                ^
Main.cpp:15:16: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:20:24: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   20 |     int getParent(int v) {
      |                        ^
Main.cpp:20:24: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:26:32: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   26 |     void uniteSets(int v, int u) {
      |                                ^
Main.cpp:26:32: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:33:10: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   33 |     ~DSU() {}
      |          ^
Main.cpp:33:10: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:40:16: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   40 | void dfs1(int v) {
      |                ^
Main.cpp:40:16: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:50:23: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   50 | void dfs2(int v, int k) {
      |                       ^
Main.cpp:50:23: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:68:19: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   68 | void dfsAns1(int v) {
      |                   ^
Main.cpp:68:19: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:79:19: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   79 | void dfsAns2(int v) {
      |                   ^
Main.cpp:79:19: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:94:20: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
   94 | void dfsCalc1(int v) {
      |                    ^
Main.cpp:94:20: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:105:20: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
  105 | void dfsCalc2(int v) {
      |                    ^
Main.cpp:105:20: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp:116:12: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
  116 | void solve() {
      |            ^
Main.cpp:116:12: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp: In function 'void solve()':
Main.cpp:148:66: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
  148 |     sort(vset.begin(), vset.end(), [&](const int& A, const int& B) {
      |                                                                  ^
Main.cpp:148:66: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
Main.cpp: At global scope:
Main.cpp:240:10: warning: bad option '-favx' to attribute 'optimize' [-Wattributes]
  240 | int main() {
      |          ^
Main.cpp:240:10: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes]
#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...