Submission #822939

# Submission time Handle Problem Language Result Execution time Memory
822939 2023-08-12T05:30:40 Z mindiyak Wiring (IOI17_wiring) C++14
0 / 100
0 ms 212 KB
#include "wiring.h"
#include <queue>
#include <algorithm>
#include <iostream>
using namespace std;

#define ll long long

long long min_total_length(std::vector<int> r, std::vector<int> b) {
	ll ans=0;

	for(int i=0;i<r.size();i++)ans += abs(r[i]-b[0]);
	for(int i=0;i<b.size();i++)ans += abs(r[r.size()-1]-b[i]);

	return ans;
}

Compilation message

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:12:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(int i=0;i<r.size();i++)ans += abs(r[i]-b[0]);
      |              ~^~~~~~~~~
wiring.cpp:13:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |  for(int i=0;i<b.size();i++)ans += abs(r[r.size()-1]-b[i]);
      |              ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 3rd lines differ - on the 1st token, expected: '25859', found: '52907'
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: '904', found: '949'
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: '316', found: '364'
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: '27', found: '150'
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: '52907'
2 Halted 0 ms 0 KB -