結果
問題 | No.2888 Mamehinata |
ユーザー | nono00 |
提出日時 | 2024-09-13 21:33:21 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,776 bytes |
コンパイル時間 | 3,258 ms |
コンパイル使用メモリ | 254,344 KB |
実行使用メモリ | 16,756 KB |
最終ジャッジ日時 | 2024-09-13 21:33:38 |
合計ジャッジ時間 | 8,992 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 3 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | WA | - |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | WA | - |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 21 ms
5,376 KB |
testcase_14 | AC | 21 ms
7,168 KB |
testcase_15 | WA | - |
testcase_16 | AC | 108 ms
13,184 KB |
testcase_17 | WA | - |
testcase_18 | AC | 40 ms
5,888 KB |
testcase_19 | AC | 103 ms
12,928 KB |
testcase_20 | AC | 94 ms
11,264 KB |
testcase_21 | AC | 83 ms
11,008 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | AC | 100 ms
14,280 KB |
testcase_25 | AC | 77 ms
13,780 KB |
testcase_26 | AC | 81 ms
13,696 KB |
testcase_27 | AC | 40 ms
11,648 KB |
testcase_28 | AC | 15 ms
5,376 KB |
testcase_29 | AC | 39 ms
7,680 KB |
testcase_30 | AC | 114 ms
14,208 KB |
testcase_31 | AC | 93 ms
12,416 KB |
testcase_32 | AC | 58 ms
9,728 KB |
testcase_33 | AC | 85 ms
11,648 KB |
testcase_34 | AC | 61 ms
10,496 KB |
testcase_35 | AC | 54 ms
9,472 KB |
testcase_36 | AC | 129 ms
15,232 KB |
testcase_37 | AC | 136 ms
15,616 KB |
testcase_38 | AC | 26 ms
6,912 KB |
testcase_39 | AC | 93 ms
13,184 KB |
testcase_40 | AC | 140 ms
15,360 KB |
testcase_41 | AC | 17 ms
5,376 KB |
testcase_42 | AC | 102 ms
13,440 KB |
testcase_43 | AC | 68 ms
13,768 KB |
testcase_44 | AC | 82 ms
15,212 KB |
testcase_45 | AC | 96 ms
16,756 KB |
testcase_46 | AC | 11 ms
5,376 KB |
testcase_47 | AC | 79 ms
14,856 KB |
testcase_48 | AC | 66 ms
10,716 KB |
testcase_49 | AC | 11 ms
5,376 KB |
testcase_50 | AC | 29 ms
5,888 KB |
testcase_51 | AC | 3 ms
5,376 KB |
testcase_52 | AC | 2 ms
5,376 KB |
testcase_53 | AC | 6 ms
5,376 KB |
testcase_54 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; template <class T> using max_heap = priority_queue<T>; template <class T> using min_heap = priority_queue<T, vector<T>, greater<T>>; #define rep(i, l, r) for (ll i = (l); i < (r); i++) #define rrep(i, r, l) for (ll i = (r); i-- > (l);) #define all(x) begin(x), end(x) template <class T> bool chmin(T& lhs, T rhs) { return lhs > rhs ? (lhs = rhs, true) : false; } template <class T> bool chmax(T& lhs, T rhs) { return lhs < rhs ? (lhs = rhs, true) : false; } struct IOIO { IOIO() { cin.tie(0)->sync_with_stdio(0); } } ioio; template <class S, class T> ostream& operator<<(ostream& os, const pair<S, T>& p) { os << '(' << p.first << ", " << p.second << ')'; return os; } template <class T> ostream& operator<<(ostream& os, const vector<T>& vs) { os << '{'; rep(i, 0, (int)vs.size()) os << vs[i] << (i + 1 == (int)vs.size() ? "" : ", "); os << '}'; return os; } template <class T> ostream& operator<<(ostream& os, const set<T>& vs) { os << '{'; for (auto it = vs.begin(); it != vs.end(); it++) { if (it != vs.begin()) { os << ", "; } os << *it; } os << '}'; return os; } template <class T, class U> ostream& operator<<(ostream& os, const map<T, U>& vs) { os << '{'; for (auto it = vs.begin(); it != vs.end(); it++) { if (it != vs.begin()) { os << ", "; } os << *it; } os << '}'; return os; } #ifdef DEBUG void dump_func() { cerr << endl; } template <class Head, class... Tail> void dump_func(Head&& head, Tail&&... tail) { cerr << head; if (sizeof...(Tail) > 0) { cerr << ", "; } dump_func(std::move(tail)...); } #define dump(...) cerr << "[" + string(#__VA_ARGS__) + "] ", dump_func(__VA_ARGS__) #else #define dump(...) static_cast<int>(0) #endif int main() { int n, m; cin >> n >> m; vector graph(n, vector<int>()); rep(i, 0, m) { int u, v; cin >> u >> v; u--; v--; graph[u].push_back(v); graph[v].push_back(u); } vector<int> dist(n, -1); dist[0] = 0; queue<int> que; que.push(0); while (!que.empty()) { int u = que.front(); que.pop(); for (auto v: graph[u]) { if (dist[v] == -1) { dist[v] = dist[u] + 1; que.push(v); } } } int odd = 0; int even = 1; vector<int> freq(n + 1); rep(i, 0, n) if (dist[i] != -1) freq[dist[i]]++; rep(i, 0, n) { if (i % 2 == 0) { odd += freq[i + 1]; cout << odd << '\n'; } else { even += freq[i + 1]; cout << even << '\n'; } } }