QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#49591 | #2283. Decelerating Jump | asdasdasfasdfasdfsdaf | WA | 2ms | 3676kb | C++11 | 1.2kb | 2022-09-22 07:37:13 | 2022-09-22 07:37:16 |
Judging History
answer
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cstring>
#include <functional>
#include <algorithm>
#include <bitset>
#include <numeric>
#define sk(i, x) for(uint64_t i = 0; i < x; i++)
#define skc(i, start, x) for(uint64_t i = start; i < x; i++)
#define chin(x) char x; std::cin >> x;
#define slin(x) int64_t x; std::cin >> x
#define lin(x) uint64_t x; std::cin >> x
#define qsort(x) std::sort(x.begin(), x.end())
#define qmaxv(x) *std::max_element(x.begin(), x.end());
#define vsum(x) std::accumulate( x.begin(), x.end(), 0 )
typedef std::vector<int64_t> slv;
typedef std::vector<uint64_t> uslv;
typedef std::vector<int32_t> siv;
typedef std::vector<uint32_t> uiv;
typedef std::vector<bool> bv;
int main()
{
lin( n );
slv squares( n );
sk( i, n )
{
slin( a );
squares[i] = a;
}
int64_t highest_score = squares[0] + squares[n - 1];
skc( start_pos, 1, n )
{
int64_t score = squares[0] + squares[n-1];
skc( i, start_pos, n-1 )
{
score += squares[i];
}
if( score > highest_score ) {
highest_score = score;
}
}
std::cout << highest_score << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3516kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3528kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
3
result:
ok single line: '3'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3508kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
7
result:
ok single line: '7'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3596kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
12
result:
ok single line: '12'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3488kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
27
result:
ok single line: '27'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...
output:
35
result:
ok single line: '35'
Test #7:
score: 0
Accepted
time: 2ms
memory: 3444kb
input:
2 0 0
output:
0
result:
ok single line: '0'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3664kb
input:
2 -1 -9
output:
-10
result:
ok single line: '-10'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3512kb
input:
10 -1 0 1 0 0 0 1 1 1 -1
output:
2
result:
ok single line: '2'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3584kb
input:
20 -2 -2 -1 -1 -2 1 0 1 2 3 -1 2 1 3 2 3 -1 -2 -1 3
output:
14
result:
ok single line: '14'
Test #11:
score: -100
Wrong Answer
time: 2ms
memory: 3676kb
input:
10 3 10 -2 -9 4 -7 5 -7 -4 -5
output:
-2
result:
wrong answer 1st lines differ - expected: '3', found: '-2'