답안 #881810

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
881810 2023-12-02T02:47:19 Z Regulus Super Dango Maker (JOI22_dango3) C++17
0 / 100
10000 ms 348 KB
#include "dango3.h"
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(false);cin.tie(0);
#define debug(x) cerr << #x << " = " << (x) << ' '
#define endl cerr << '\n'
#define all(v) (v).begin(), (v).end()
#define SZ(v) (ll)(v).size()
#define lowbit(x) (x)&-(x)
#define pb emplace_back
#define F first
#define S second
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
 
const int N = 105;
ll nn, mm, cnt[N], a[N];
vector<int> v[N];
 
inline void dfs(int d)
{
    if (d > nn*mm)
    {
        int i, j, ret;
        for (i=1; i <= nn; ++i)
        {
            ret = Query(v[i]);
            if (ret != 1) break;
        }
        if (i > nn)
        {
            for (i=0; i < mm; ++i) Answer(v[i]);
            exit(0);
        }
        return;
    }
 
    for (int i=1; i <= nn; ++i)
    {
        if (!cnt[i]) continue;
        a[d] = i, --cnt[i], v[i].pb(d);
        dfs(d+1);
        v[i].pop_back(), ++cnt[i];
    }
}
 
void Solve(int n, int m)
{
    ll i, j;
 
    nn = n, mm = m;
    for (i=1; i <= nn; ++i) cnt[i] = mm;
    dfs(1);
}

Compilation message

dango3.cpp: In function 'void dfs(int)':
dango3.cpp:24:16: warning: unused variable 'j' [-Wunused-variable]
   24 |         int i, j, ret;
      |                ^
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:49:11: warning: unused variable 'j' [-Wunused-variable]
   49 |     ll i, j;
      |           ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 344 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 10043 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 10053 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 10038 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -