提出 #69547367


ソースコード 拡げる

// To scale the heights, one must embrace the fall.
#include <bits/stdc++.h>
#define fi first
#define se second
#define int long long
#define pb emplace_back
#define F(i, a, b) for (int i = (a); i <= (b); ++i)
#define dF(i, a, b) for (int i = (a); i >= (b); --i)
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int N = 200005, M = (N << 1), inf = 1e16, mod = 1e9 + 7;
int n, m, c, a[N];
signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> n >> m;
    F(i, 1, m) {
        int u, v;
        cin >> u >> v;
        a[u]++, a[v]++;
    } 
    F(i, 1, n) if (a[i] % 2 != (n - 1) % 2) c++;
    cout << n * (n - 1) / 2 - c / 2 << '\n';
    return 0;
}

提出情報

提出日時
問題 B - Triangle Toggle
ユーザ zhutianrui
言語 C++ 20 (gcc 12.2)
得点 500
コード長 741 Byte
結果 AC
実行時間 22 ms
メモリ 5176 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 500 / 500
結果
AC × 3
AC × 22
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3348 KiB
00_sample_01.txt AC 1 ms 3488 KiB
00_sample_02.txt AC 1 ms 3416 KiB
01_handmade_00.txt AC 1 ms 3468 KiB
01_handmade_01.txt AC 12 ms 5044 KiB
01_handmade_02.txt AC 11 ms 5048 KiB
01_handmade_03.txt AC 1 ms 3408 KiB
01_handmade_04.txt AC 1 ms 3404 KiB
01_handmade_05.txt AC 1 ms 3488 KiB
01_handmade_06.txt AC 1 ms 3484 KiB
01_handmade_07.txt AC 14 ms 3424 KiB
01_handmade_08.txt AC 14 ms 3480 KiB
02_random_00.txt AC 15 ms 3896 KiB
02_random_01.txt AC 17 ms 3700 KiB
02_random_02.txt AC 6 ms 4724 KiB
02_random_03.txt AC 17 ms 4016 KiB
02_random_04.txt AC 7 ms 3412 KiB
02_random_05.txt AC 22 ms 4900 KiB
02_random_06.txt AC 13 ms 5048 KiB
02_random_07.txt AC 22 ms 5044 KiB
02_random_08.txt AC 20 ms 5176 KiB
02_random_09.txt AC 21 ms 5108 KiB