제출 #1252738

#제출 시각아이디문제언어결과실행 시간메모리
1252738zipdang04세계 지도 (IOI25_worldmap)C++20
15 / 100
1098 ms68200 KiB
#include "worldmap.h"

#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
*/

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template <class T> using PQMax = priority_queue<T>;
template <class T> using PQMin = priority_queue<T, vector<T>, greater<T>>;
template <class T1, class T2>
void maximize(T1 &a, T2 b){
    if (b > a) a = b;
}
template <class T1, class T2>
void minimize(T1 &a, T2 b){
    if (b < a) a = b;
}
template <class T>
void read(T &number)
{
    bool negative = false;
    register int c;
    number = 0;
    c = getchar();
    while (c != '-' && !isalnum(c)) c = getchar();
    if (c=='-'){
        negative = true;
        c = getchar();
    }
    for (; (c>47 && c<58); c=getchar())
        number = number *10 + c - 48;
    if (negative)
        number *= -1;
}
template <class T, class ...Ts>
void read(T &a, Ts& ... args){
    read(a);
    read(args...);
}

/*
struct Node
{
    int node, len;
    Node() {node = len = 0;}
    Node(int node, int len) {this -> node = node, this -> len = len;}
};
typedef vector<Node> vg;
*/

#define fi first
#define se second

#define FOR(type, i, a, b) for(type i = (a); i <= (b); i++)
#define REV(type, i, b, a) for(type i = (b); i >= (a); i--)

#define testBit(n, bit) (((n) >> (bit)) & 1)
#define flipBit(n, bit) ((n) ^ (1ll << (bit)))
#define cntBit(n) __builtin_popcount(n)
#define cntBitll(n) __builtin_popcountll(n)
#define log2(n) (31 - __builtin_clz(n))
#define log2ll(n) (63 - __builtin_clzll(n))
#define CURRENT_TIMESTAMP chrono::steady_clock::now().time_since_epoch().count()
#define randomize mt19937_64 mt(CURRENT_TIMESTAMP)

#define MAX 1000001
#define MOD 1000000007

int n, m;
vector<int> graph[MAX];

namespace Subtask12 {
    vector<int> euler;
    void dfs(int u, int p) {
        cerr << u << ' ' << p << '\n';
        euler.push_back(u);
        bool oke = false;
        for (int v: graph[u]) if (v != p)
            dfs(v, u), euler.push_back(u);
    }
    vector<vector<int>> solve() {
        dfs(1, 0);
        int sz = euler.size();
        return vector<vector<int>>(sz, euler);
    }
}

void clear();
std::vector<std::vector<int>> create_map(int _N, int _M, std::vector<int> _A, std::vector<int> _B) {
    clear();
    n = _N, m = _M;
    for (int i = 0; i < m; i++) {
        int u = _A[i], v = _B[i];
        graph[u].push_back(v);
        graph[v].push_back(u);
    }

    return Subtask12::solve();
    // return ans;
}

void clear(){
    Subtask12::euler.clear();
    FOR(int, i, 1, n) graph[i].clear();
    n = m =0;
}

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

worldmap.cpp: In function 'void read(T&)':
worldmap.cpp:30:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   30 |     register int c;
      |                  ^
#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...