QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#392990#2432. Go with the FlownocrizWA 490ms4012kbC++14748b2024-04-18 01:43:002024-04-18 01:43:01

Judging History

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

  • [2024-04-18 01:43:01]
  • 评测
  • 测评结果:WA
  • 用时:490ms
  • 内存:4012kb
  • [2024-04-18 01:43:00]
  • 提交

answer

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

int main() {
	int n;
	cin>>n;
	vector<int> ln;

	int cm = 0;
	for(int i=0;i<n;i++) {
		string s;
		cin>>s;
		cm = max(0, (int)s.size());
		ln.push_back(s.size());
	}
	int ans = 0, ccl;
	for(int ml = cm; ml<= n * 85; ml++) {
		vector<int> cx(ml, 0), nx(ml, 0);
		int cv = -1, cln = 0;
		for(auto ct: ln) {
			if(cv + 1 + ct > ml) {
				cln += 1;
				cv = -1;
				cx = nx;
				nx = vector<int>(ml, 0);
			}
			if(cv > 0) {
				nx[cv] = max(max(cx[cv-1], cx[cv]), cx[cv+1]) + 1;
				//cout<<cv<<' '<<nx[cv]<<endl;
				if(nx[cv] > ans) {
					ans = nx[cv];
					ccl = ml;
				}
			}
			cv = cv + 1 + ct;
		}
		if( cln < ans) break;
	}
	cout<<ccl<<' '<<ans<<endl;
}

Details

Test #1:

score: 100
Accepted
time: 0ms
memory: 3624kb

Test #2:

score: 0
Accepted
time: 0ms
memory: 3624kb

Test #3:

score: 0
Accepted
time: 0ms
memory: 3616kb

Test #4:

score: 0
Accepted
time: 0ms
memory: 3620kb

Test #5:

score: 0
Accepted
time: 0ms
memory: 3620kb

Test #6:

score: 0
Accepted
time: 0ms
memory: 3616kb

Test #7:

score: 0
Accepted
time: 0ms
memory: 3620kb

Test #8:

score: 0
Accepted
time: 0ms
memory: 3628kb

Test #9:

score: 0
Accepted
time: 0ms
memory: 3552kb

Test #10:

score: 0
Accepted
time: 0ms
memory: 3852kb

Test #11:

score: 0
Accepted
time: 0ms
memory: 3852kb

Test #12:

score: 0
Accepted
time: 0ms
memory: 3784kb

Test #13:

score: 0
Accepted
time: 3ms
memory: 3668kb

Test #14:

score: 0
Accepted
time: 3ms
memory: 3624kb

Test #15:

score: 0
Accepted
time: 0ms
memory: 3664kb

Test #16:

score: 0
Accepted
time: 35ms
memory: 4012kb

Test #17:

score: 0
Accepted
time: 31ms
memory: 3780kb

Test #18:

score: 0
Accepted
time: 30ms
memory: 3696kb

Test #19:

score: 0
Accepted
time: 3ms
memory: 3688kb

Test #20:

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

Test #21:

score: 0
Accepted
time: 212ms
memory: 3856kb

Test #22:

score: 0
Accepted
time: 7ms
memory: 3696kb

Test #23:

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

Test #24:

score: 0
Accepted
time: 0ms
memory: 3644kb

Test #25:

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

Test #26:

score: 0
Accepted
time: 185ms
memory: 3824kb

Test #27:

score: 0
Accepted
time: 183ms
memory: 3856kb

Test #28:

score: 0
Accepted
time: 30ms
memory: 3788kb

Test #29:

score: 0
Accepted
time: 37ms
memory: 3740kb

Test #30:

score: 0
Accepted
time: 33ms
memory: 3728kb

Test #31:

score: 0
Accepted
time: 490ms
memory: 4008kb

Test #32:

score: 0
Accepted
time: 20ms
memory: 3732kb

Test #33:

score: 0
Accepted
time: 7ms
memory: 3688kb

Test #34:

score: -100
Wrong Answer
time: 1ms
memory: 3584kb