結果

問題 No.488 四角関係
ユーザー 1119_29161119_2916
提出日時 2017-02-24 23:03:18
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,568 bytes
コンパイル時間 1,573 ms
コンパイル使用メモリ 149,740 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-30 23:42:23
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 31 ms
4,384 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
 
using namespace std;
 
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
 
//int dxy[5] = {0, 1, 0, -1, 0};
// assign
 
vvb graph(50, vb(50, false));
int st, n;

int solve(int pos, int d);

   
signed main()
{
    int m;
    cin >> n >> m;
    rep(i, m) {
        int2(a, b);
        graph[a][b] = true;
        graph[b][a] = true;
    }
    int ans = 0;

    rep(i, n) {
        for (int j = 0; j < n; j++) {
            if (i == j) { continue; }
            for (int k = 0; k < n; k++) {
                if (i == k || j == k) { continue; }
                for (int l = 0; l < n; l++) {
                    if (i == l || j == l || k == l) { continue; }
                    if (graph[i][j] && graph[j][k] && graph[k][l] && 
                            graph[l][i] && !graph[i][k] && !graph[j][l]) {
                        ans++;
                        cout << i << j << k << l << endl;
                    }
                }
            }
        }
    }
    cout << (ans/8) + ((ans % 8) ? 1 : 0) << endl;
    return 0;
}

0