結果

問題 No.488 四角関係
ユーザー tubo28tubo28
提出日時 2017-04-06 02:16:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 894 ms / 5,000 ms
コード長 1,502 bytes
コンパイル時間 1,593 ms
コンパイル使用メモリ 171,460 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 20:31:17
合計ジャッジ時間 25,742 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 883 ms
4,376 KB
testcase_01 AC 881 ms
4,376 KB
testcase_02 AC 880 ms
4,376 KB
testcase_03 AC 879 ms
4,380 KB
testcase_04 AC 886 ms
4,376 KB
testcase_05 AC 884 ms
4,380 KB
testcase_06 AC 880 ms
4,380 KB
testcase_07 AC 894 ms
4,376 KB
testcase_08 AC 885 ms
4,380 KB
testcase_09 AC 877 ms
4,380 KB
testcase_10 AC 879 ms
4,380 KB
testcase_11 AC 876 ms
4,380 KB
testcase_12 AC 882 ms
4,384 KB
testcase_13 AC 880 ms
4,380 KB
testcase_14 AC 879 ms
4,376 KB
testcase_15 AC 878 ms
4,376 KB
testcase_16 AC 878 ms
4,380 KB
testcase_17 AC 879 ms
4,376 KB
testcase_18 AC 882 ms
4,380 KB
testcase_19 AC 878 ms
4,380 KB
testcase_20 AC 877 ms
4,376 KB
testcase_21 AC 875 ms
4,380 KB
testcase_22 AC 877 ms
4,376 KB
testcase_23 AC 879 ms
4,376 KB
testcase_24 AC 878 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, int(n) + 1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
const int MOD = 1000000007;

template <typename T>
void __dump__(std::ostream &os, const T &first) {
    os << first;
}
template <typename First, typename... Rest>
void __dump__(std::ostream &os, const First &first, const Rest &... rest) {
    os << first << ", ";
    __dump__(os, rest...);
}
#define dump(...)                                         \
    do {                                                  \
        std::ostringstream os;                            \
        os << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; \
        __dump__(os, __VA_ARGS__);                        \
        std::cerr << os.str() << std::endl;               \
    } while (0)

int main() {
    int n, m;
    cin >> n >> m;
    int g[55][55] = {};
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        g[a][b] = g[b][a] = 1;
    }
    int ans = 0;
    rep(i, 50) rep(j, 50) rep(k, 50) rep(l, 50) {
        if ((set<int> { i, j, k, l }).size() == 4 &&
            g[i][j] && g[j][k] && g[k][l] && g[l][i] &&
            !g[i][k] && !g[j][l]) {
            ++ans;
        }
    }
    dump(ans);
    ans /= 8;
    cout << ans << endl;
}
0