Submission #610808

# Submission time Handle Problem Language Result Execution time Memory
610808 2022-07-28T14:42:26 Z AriaH Wiring (IOI17_wiring) C++17
13 / 100
23 ms 3788 KB
#include "wiring.h"
#pragma GCC optimize("O3")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define SZ(x) (int)x.size()
#define Mp make_pair
#define endl "\n"
#define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int N = 1e6 + 10;
const int LOG = 20;
const ll mod = 1e9 + 7;
const ll inf = 8e18;

ll min_total_length(vector < int > r, vector < int > b)
{
	reverse(all(r));
	ll ret = 0;
	int n = SZ(r), m = SZ(b);
	for(int i = 0; i < min(n, m); i ++)
	{
		ret += abs(r[i] - b[i]);
	}
	if(n > m)
	{
		for(int i = m; i < n; i ++) ret += b[0] - r[i];
	}
	else
	{
		for(int i = n; i < m; i ++) ret += b[i] - r[0];
	}
	return ret;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '25859', found: '27471'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 17 ms 2920 KB Output is correct
4 Correct 16 ms 2924 KB Output is correct
5 Correct 23 ms 2900 KB Output is correct
6 Correct 21 ms 3764 KB Output is correct
7 Correct 21 ms 3748 KB Output is correct
8 Correct 20 ms 3788 KB Output is correct
9 Correct 23 ms 3764 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '17703', found: '21996'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '27', found: '100'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '25859', found: '27471'
2 Halted 0 ms 0 KB -