답안 #826983

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
826983 2023-08-16T07:46:05 Z tolbi Shortcut (IOI16_shortcut) C++17
0 / 100
1 ms 300 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#include "shortcut.h"
long long find_shortcut(int n, std::vector<int> pref, std::vector<int> d, int c)
{
    for (int i = 1; i < pref.size(); i++){
        pref[i]+=pref[i-1];
    }
    function<ll(int,int)> query;
    query = [&](int l, int r)->ll{
        if (r<l) swap(l,r);
        r--;
        int hueh = 0;
        if (l) hueh = pref[l-1];
        return pref[r]-hueh;
    };
    ll ans = LONG_LONG_MAX;
    for (int l = 0; l < n; l++){
        for (int r = l+1; r < n; r++){
            ll crr = 0;
            for (int i = 0; i < n; i++){
                for (int j = i+1; j < n; j++){
                    ll cr1 = query(i,j);
                    ll cr2 = query(l,i)+query(r,j)+c;
                    crr=max(crr,min(cr1,cr2)+(ll)d[i]+(ll)d[j]);
                }
            }
            ans=min(ans,crr);
        }
    }
    return ans;
}

Compilation message

shortcut.cpp: In function 'long long int find_shortcut(int, std::vector<int>, std::vector<int>, int)':
shortcut.cpp:7:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for (int i = 1; i < pref.size(); i++){
      |                     ~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB n = 4, 80 is a correct answer
2 Correct 1 ms 296 KB n = 9, 110 is a correct answer
3 Correct 0 ms 212 KB n = 4, 21 is a correct answer
4 Correct 0 ms 296 KB n = 3, 4 is a correct answer
5 Correct 0 ms 212 KB n = 2, 62 is a correct answer
6 Correct 0 ms 212 KB n = 2, 3 is a correct answer
7 Correct 1 ms 300 KB n = 3, 29 is a correct answer
8 Correct 0 ms 212 KB n = 2, 3 is a correct answer
9 Correct 1 ms 212 KB n = 2, 3 is a correct answer
10 Correct 0 ms 212 KB n = 2, 2000000001 is a correct answer
11 Correct 1 ms 212 KB n = 2, 3000000000 is a correct answer
12 Correct 0 ms 212 KB n = 3, 3000000000 is a correct answer
13 Correct 1 ms 212 KB n = 3, 3000000000 is a correct answer
14 Correct 1 ms 296 KB n = 4, 3000000001 is a correct answer
15 Correct 1 ms 300 KB n = 4, 4000000000 is a correct answer
16 Correct 0 ms 212 KB n = 5, 4000000000 is a correct answer
17 Correct 1 ms 300 KB n = 10, 1000000343 is a correct answer
18 Correct 0 ms 212 KB n = 10, 3189 is a correct answer
19 Incorrect 1 ms 212 KB n = 10, incorrect answer: jury 7000000000 vs contestant 4000000000
20 Halted 0 ms 0 KB -