QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#217231#7118. Closing Timehocky#0 45ms23248kbC++141.6kb2023-10-16 17:20:032024-04-28 07:52:55

Judging History

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

  • [2024-04-28 07:52:55]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:45ms
  • 内存:23248kb
  • [2023-10-16 17:20:03]
  • 评测
  • 测评结果:0
  • 用时:51ms
  • 内存:23160kb
  • [2023-10-16 17:20:03]
  • 提交

answer

#include "closing.h"

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL, LL> PLL;
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i = a;i < b;i++)
#define trav(nx, v) for(auto &nx : v)
#define all(a) begin(a), end(a)
#define sz(v) (int) v.size()


priority_queue <PLL, vector <PLL>, greater<PLL>> prim;
const int LIM = 200000;
vector <PLL> edge[LIM + 5];
bool isInside[LIM + 5];

int max_score(int N, int X, int Y, long long K,
              std::vector<int> U, std::vector<int> V, std::vector<int> W){
	rep(i,0,N) {
		edge[i].clear();
		isInside[i] = 0;
	}
	//~ cout << "Here " << U[0] << " " << V[0] << ""  << W[0] << endl;
	while(!prim.empty()) prim.pop();
	rep(i,0,N - 1){
		if(W[i] > K) continue;
		//~ cout << U[i] << " " << V[i] << endl;
		edge[U[i]].emplace_back(V[i], W[i]);
		edge[V[i]].emplace_back(U[i], W[i]);
		
	}
	isInside[X] = isInside[Y] = 1;
	LL ans = 2;
	trav(tmp, edge[X]){
		//~ cout << X << " " << tmp.fi << "?" << endl;
		prim.push({tmp.se, tmp.fi});
	}
	trav(tmp, edge[Y]) {
		prim.push({tmp.se, tmp.fi});
		//~ cout << Y << " " << tmp.fi << "?" << endl;
	}
	while(sz(prim)){
		auto currentTop = prim.top();
		//~ cout << "here " << K << " " << currentTop.fi << " " << currentTop.se << endl;
		prim.pop();
		if(K < currentTop.fi) break;
		if(isInside[currentTop.se]) continue;
		trav(cur, edge[currentTop.se]){
			prim.push({cur.se + currentTop.se, cur.fi});
		}
		K -= currentTop.fi;
		ans++;
		isInside[currentTop.se] = 1;
	}
    return ans;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 45ms
memory: 23248kb

input:

cc61ad56a4797fb3f5c9529f73ce6fcedd85669b
1
200000 31011 61157 8517583098
31011 129396 964383
1655 129396 331139
1655 191487 566483
110385 191487 865248
43212 110385 542661
43212 81682 13766
81682 91774 546589
91774 124706 780638
124706 175650 118706
10421 175650 615314
10421 151953 436270
140430 151...

output:

081ce3c351cbf526b37954b9ad30f2b531a7585c
OK
31176

result:

wrong answer 1st lines differ - on the 1st token, expected: '451', found: '31176'

Subtask #2:

score: 0
Wrong Answer

Test #4:

score: 0
Wrong Answer
time: 2ms
memory: 8464kb

input:

cc61ad56a4797fb3f5c9529f73ce6fcedd85669b
1
50 23 25 382806473
0 1 375710
1 2 898637
2 3 10402
3 4 536577
4 5 385023
5 6 71075
6 7 543368
7 8 301497
8 9 174394
9 10 711312
10 11 923006
11 12 675532
12 13 838667
13 14 565729
14 15 979816
15 16 862618
16 17 576015
17 18 177751
18 19 306989
19 20 881492...

output:

081ce3c351cbf526b37954b9ad30f2b531a7585c
OK
50

result:

wrong answer 1st lines differ - on the 1st token, expected: '96', found: '50'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Wrong Answer

Test #36:

score: 0
Wrong Answer
time: 0ms
memory: 8488kb

input:

cc61ad56a4797fb3f5c9529f73ce6fcedd85669b
1
4 0 1 9
0 2 2
1 2 3
2 3 3

output:

081ce3c351cbf526b37954b9ad30f2b531a7585c
OK
4

result:

wrong answer 1st lines differ - on the 1st token, expected: '6', found: '4'

Subtask #6:

score: 0
Skipped

Dependency #2:

0%

Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Skipped

Dependency #4:

0%

Subtask #9:

score: 0
Skipped

Dependency #1:

0%