Submission #393574

# Submission time Handle Problem Language Result Execution time Memory
393574 2021-04-24T03:59:03 Z tinjyu Reversing a Sequence (IOI16_reverse) C++14
100 / 100
42 ms 5808 KB
#include "reverse.h"
#include <iostream>
using namespace std;
std::vector<long long> reverse(std::vector<long long> a) {
	for(int i=0;i<a.size()/2;i++)
	{
		swap(a[i],a[a.size()-i-1]);
	}
	return a;
}

Compilation message

reverse.cpp: In function 'std::vector<long long int> reverse(std::vector<long long int>)':
reverse.cpp:5:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 |  for(int i=0;i<a.size()/2;i++)
      |              ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 2 ms 460 KB Output is correct
8 Correct 5 ms 844 KB Output is correct
9 Correct 14 ms 1972 KB Output is correct
10 Correct 42 ms 5808 KB Output is correct