QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#368021#6342. Security Guardltunjic#0 9ms1640kbC++14420b2024-03-26 18:39:482024-07-04 03:31:55

Judging History

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

  • [2024-07-04 03:31:55]
  • 评测
  • 测评结果:0
  • 用时:9ms
  • 内存:1640kb
  • [2024-03-26 18:39:48]
  • 提交

answer

#include <cstdio> 
#include <algorithm>

using namespace std;

int _abs(int x) { return x < 0 ? -x : x; }

int main() {
	int n, m, q; scanf("%d%d%d", &n, &m, &q); 
	int ans = 0, f = 0, _f;
	for(int i = 0, lst = 0; i < n; ++i) {
		int x; scanf("%d", &x);
		ans += min(lst, x); 
		if(lst == 2 && x == 1) ++f;
		if(lst == 1 && x == 2) ++_f;
		lst = x;
	}
	printf("%d\n", ans + min(f, _f));
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 12
Accepted
time: 5ms
memory: 1596kb

input:

200000 199999 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

199999

result:

ok 1 number(s): "199999"

Test #2:

score: 0
Accepted
time: 8ms
memory: 1640kb

input:

200000 199999 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

399998

result:

ok 1 number(s): "399998"

Test #3:

score: -12
Wrong Answer
time: 9ms
memory: 1640kb

input:

200000 199999 0
1 2 1 1 1 2 2 1 2 1 1 2 2 2 2 1 1 2 1 1 1 1 2 2 2 1 1 2 2 1 1 1 2 1 1 2 1 1 1 1 1 1 1 2 1 2 2 1 2 1 1 2 1 2 2 2 2 1 2 2 1 2 1 2 2 2 1 1 1 2 1 1 1 2 2 1 1 1 2 2 2 2 1 1 2 2 1 1 2 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 1 2 1 1 1 2 2 2 1 2 1 1 1 2 1 2 2 2 1 2 1 1 1 1 2 2 1 1 2 1 2 1 2 1 2 ...

output:

299699

result:

wrong answer 1st numbers differ - expected: '299700', found: '299699'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Wrong Answer

Test #85:

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

input:

16 15 200000
692461146 622302385 805066691 422290641 600839873 940930580 873147413 489653843 239129952 383473127 21389393 913787109 856138328 859082963 262475462 327598064
6 13
6 9
6 15
6 14
6 16
6 8
5 6
1 6
4 6
3 6
6 11
6 7
6 10
2 6
6 12

output:

-1778841141

result:

wrong answer 1st numbers differ - expected: '14113958700', found: '-1778841141'

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

0%