結果
| 問題 |
No.9000 Hello World! (テスト用)
|
| ユーザー |
|
| 提出日時 | 2024-09-07 14:41:32 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 4,537 bytes |
| コンパイル時間 | 1,777 ms |
| コンパイル使用メモリ | 170,968 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-07 14:41:35 |
| 合計ジャッジ時間 | 2,481 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
// g++ -g program.cpp -o program.exe -D _DEBUG && .\program.exe
#include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
// TYPE ABBREVIATIONS
using ll = long long;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<string, string> ps;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<ps> vps;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<vs> vvs;
// INFINITIES
const int INF = 1 << 30;
const ll INFl = 1LL << 60;
// DATA STRUCT ABBREVIATIONS
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sortUp(x) sort(all(x))
#define sortDn(x) reverse(all(x))
#define uniqfy(x) sort(all(x));x.erase(unique(all(x)),end(x))
// LOOP ABBREVIATIONS
#define rep1(n) for (int i=0; i<n; i++)
#define rep2(i, r) for (int i=0; i<r; i++)
#define rep3(i, l, r) for (int i=l; i<r; i++)
#define rep4(i, l, r, c) for (int i=l; i<r; i+=c)
#define overload4(a, b, c, d, e, ...) e
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
// DEBUG MACROS
#ifdef _DEBUG
timeval runtimeTimer[2];
#endif
template <typename T = int> void debug(T val) {
#ifdef _DEBUG
cout << "DEBUG: " << val << endl;
#endif
}
template <typename T = int> void debugVector(vector<T> vec) {
#ifdef _DEBUG
rep(i, vec.size()-1) {
cout << vec[i] << ", ";
}
cout << vec[vec.size()-1] << endl; // don't display last comma
#endif
}
void debugSetup() {
#ifdef _DEBUG
freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
debug<string>("[Start]");
gettimeofday(&runtimeTimer[0], NULL);
#endif
}
void debugUnset() {
#ifdef _DEBUG
gettimeofday(&runtimeTimer[1], NULL);
float runtimeMilli = ((float)(runtimeTimer[1].tv_usec - runtimeTimer[0].tv_usec)) / 1000;
debug<string>("[Runtime: " + to_string(runtimeMilli) + " milliseconds]");
#endif
}
// IO MACROS
#define el "\n" // std::endl is slow
#define spc " " // @sorachandu
template <typename T = int> T nxt() {
T x;
cin >> x;
return x;
}
template <typename T = int> vector<T> nxlst(int n) {
vector<T> lst;
rep(i, n) {
lst.pb(nxt<T>());
}
return lst;
}
template <typename T = int> vector<vector<T>> nxmtx(int y, int x) {
vector<vector<T>> mtx;
rep(i, y) {
vector<T> lst = nxlst(x);
mtx.pb(lst);
}
return mtx; // first idx y value, second idx x value
}
// IDK BUT ITS HERE IG
bool sortByFi(pi p, pi q) {
return (p.fi < q.fi);
}
bool sortBySe(pi p, pi q) {
return (p.se < q.se);
}
// DATA STRUCTURES
class UnionFind {
private:
vi _size;
vi _parent;
public:
UnionFind(int n) {
_size = vector<int>(n, 1);
_parent = vector<int>(n, -1);
}
int find(int v) {
if (_parent[v] == -1) {
return v;
} else {
vi verts;
while (_parent[v] >= 0) {
verts.pb(v);
v = _parent[v];
}
for (int i : verts) {
_parent[i] = v;
}
return v;
}
}
bool merge(int x, int y) {
x = find(x);
y = find(y);
if (x == y) {
return false;
}
if (_size[x] < _size[y]) {
x, y = y, x;
}
_parent[y] = x;
_size[x] = _size[x] + _size[y];
return true;
}
vi allSets() {
unordered_set<int> sets;
rep(i, _parent.size()) {
sets.insert(find(i));
}
return vi(all(sets));
}
bool same(int x, int y) {
x = find(x);
y = find(y);
return x == y;
}
int size(int x) {
return _size[find(x)];
}
};
int main() {
debugSetup();
cout << "Hello World!" << el;
debugUnset();
return 0;
}