QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#424918#8724. Septembermaomao90#0 1ms3880kbC++201.6kb2024-05-29 19:53:162024-05-29 19:53:17

Judging History

你现在查看的是最新测评结果

  • [2024-05-29 19:53:17]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3880kb
  • [2024-05-29 19:53:16]
  • 提交

answer

#include "september.h"
#include <bits/stdc++.h>
using namespace std;

#define REP(i, j, k) for (int i = j; i < (k); i++)
#define RREP(i, j, k) for (int i = j; i >= (k); i--)

template <typename T>
bool mnto(T &a, const T &b) {return b < a ? a = b, 1 : 0;}
template <typename T>
bool mxto(T &a, const T &b) {return b > a ? a = b, 1 : 0;}

typedef long long ll;
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
#define pb push_back
#define SZ(x) ((int) x.size())
#define ALL(x) x.begin(), x.end()
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef tuple<int, int, int> iii;
typedef tuple<ll, ll, ll> lll;
typedef vector<iii> viii;
typedef vector<lll> vlll;

#ifndef DEBUG
#define cerr if (0) cerr
#endif

const int INF = 1000000005;
const ll LINF = 1000000000000000005;
const int MAXN = 100005;

int n, m;
vi p;
vector<vi> s;
vi adj[MAXN];
int badch[MAXN];
bool mark[MAXN];
int msk[MAXN];

int solve(int N, int M, vi F, vector<vi> S) {
    n = N; m = M; p = F; s = S;
    REP (i, 0, n) {
        adj[i].clear();
    }
    REP (i, 1, n) {
        adj[p[i]].pb(i);
    }
    REP (k, 0, m) {
        REP (i, 0, n) {
            badch[i] = SZ(adj[i]);
            mark[i] = 0;
        }
        int bcnt = 0;
        REP (t, 0, n - 1) {
            int i = s[k][t];
            mark[i] = 1;
            bcnt += badch[i];
            badch[p[i]]--;
            if (mark[p[i]]) {
                bcnt--;
            }
            msk[t] |= (bcnt == 0) << k;
        }
    }
    int ans = 0;
    REP (i, 0, n - 1) {
        ans += msk[i] == (1 << m) - 1;
    }
	return ans;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 11
Accepted
time: 0ms
memory: 3880kb

input:

txy4h26c1rm1uv8tr3eonahd67u8h56x
4
7 1
0 0 2 3 3 5
1 6 4 3 5 2
10 1
0 1 2 0 3 0 5 4 8
9 7 6 8 4 5 3 2 1
7 1
0 0 0 1 3 0
2 4 1 6 5 3
6 1
0 0 1 1 3
4 5 2 3 1

output:

7ckgnn4wyi495puj3ibqf81dqvapyv6b
5
9
6
5

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 3876kb

input:

txy4h26c1rm1uv8tr3eonahd67u8h56x
4
7 1
0 1 0 2 4 0
3 6 5 2 4 1
10 1
0 0 0 0 2 1 3 3 6
5 9 6 4 7 2 3 8 1
7 1
0 0 2 0 2 2
3 5 6 2 1 4
6 1
0 0 1 2 0
3 4 2 1 5

output:

7ckgnn4wyi495puj3ibqf81dqvapyv6b
5
8
6
5

result:

ok 5 lines

Test #3:

score: -11
Wrong Answer
time: 0ms
memory: 3576kb

input:

txy4h26c1rm1uv8tr3eonahd67u8h56x
4
7 1
0 0 1 3 4 5
6 2 5 4 3 1
10 1
0 0 2 3 4 4 6 7 8
5 9 1 8 7 6 3 4 2
7 1
0 1 1 3 4 4
2 6 5 4 3 1
6 1
0 1 2 2 3
3 5 4 1 2

output:

7ckgnn4wyi495puj3ibqf81dqvapyv6b
6
8
6
5

result:

wrong answer 5th lines differ - expected: '3', found: '5'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Wrong Answer

Test #17:

score: 0
Wrong Answer
time: 1ms
memory: 3724kb

input:

txy4h26c1rm1uv8tr3eonahd67u8h56x
53
10 1
0 1 2 3 4 5 6 7 8
9 8 7 6 5 4 3 2 1
10 1
0 1 2 3 4 5 6 7 8
9 7 8 5 6 4 3 2 1
10 1
0 1 2 3 4 5 6 7 8
8 9 7 5 6 3 2 4 1
10 1
0 1 2 3 4 5 6 7 8
8 9 6 7 5 4 3 2 1
10 1
0 1 2 3 4 5 6 7 8
8 9 7 5 6 3 4 2 1
10 1
0 1 2 3 4 5 6 7 8
9 8 7 6 5 4 2 3 1
10 1
0 1 2 3 4 5 6...

output:

7ckgnn4wyi495puj3ibqf81dqvapyv6b
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
32
37
38
38
39
71
590
96
39
39
39
39
39
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9

result:

wrong answer 3rd lines differ - expected: '7', found: '9'

Subtask #4:

score: 0
Skipped

Dependency #1:

0%

Subtask #5:

score: 0
Skipped

Dependency #3:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

0%

Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

0%

Subtask #9:

score: 0
Skipped

Dependency #3:

0%

Subtask #10:

score: 0
Skipped

Dependency #1:

0%