Submission #1024883

# Submission time Handle Problem Language Result Execution time Memory
1024883 2024-07-16T11:49:36 Z c2zi6 Wiring (IOI17_wiring) C++14
13 / 100
18 ms 4440 KB
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define replr(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define reprl(i, a, b) for (int i = int(a); i >= int(b); --i)
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define mkp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VPI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<VPI> VVPI;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
typedef vector<VL> VVL;
typedef vector<VVL> VVVL;
typedef vector<VPL> VVPL;
template<class T> T setmax(T& a, T b) {if (a < b) return a = b; return a;}
template<class T> T setmin(T& a, T b) {if (a < b) return a; return a = b;}
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T>
using indset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#include "wiring.h"

namespace TEST2 {
    ll min_total_length(VI a, VI b) {
        ll ans = 0;
        int l = a.size()-1;
        int r = 0;
        while (l >= 0 && r < b.size()) {
            ans += b[r] - a[l];
            l--;
            r++;
        }
        while (l >= 0) ans += b[0] - a[l--];
        while (r < b.size()) ans += b[r++] - a.back();
        return ans;
    }
};

ll min_total_length(VI l, VI b) {
    if (l.back() < b[0]) return TEST2::min_total_length(l, b);
	return 0;
}

Compilation message

wiring.cpp: In function 'll TEST2::min_total_length(VI, VI)':
wiring.cpp:39:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |         while (l >= 0 && r < b.size()) {
      |                          ~~^~~~~~~~~~
wiring.cpp:45:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |         while (r < b.size()) ans += b[r++] - a.back();
      |                ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 3rd lines differ - on the 1st token, expected: '25859', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 18 ms 3436 KB Output is correct
4 Correct 12 ms 3416 KB Output is correct
5 Correct 12 ms 3420 KB Output is correct
6 Correct 17 ms 4436 KB Output is correct
7 Correct 16 ms 4436 KB Output is correct
8 Correct 16 ms 4392 KB Output is correct
9 Correct 16 ms 4440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '17703', found: '0'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 604 KB 3rd lines differ - on the 1st token, expected: '27', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 3rd lines differ - on the 1st token, expected: '25859', found: '0'
2 Halted 0 ms 0 KB -