답안 #1041376

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1041376 2024-08-02T00:38:50 Z arnavsrivastava0123 뒤집기 (IOI16_reverse) C++14
0 / 100
1 ms 348 KB
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define pb push_back
#define ll long long
#define ld long double
#define mp make_pair
#define F first
#define S second
 
using namespace std;


vector<ll> reverse(vector<ll> a){
   int n = a.size();
   vector<ll> b(n);
   for(int i = n - 1, j = 0; i >= 0;i--){
      b[j++] = a[j];
   }
   return b;
}

Compilation message

reverse.cpp: In function 'std::vector<long long int> reverse(std::vector<long long int>)':
reverse.cpp:18:10: warning: operation on 'j' may be undefined [-Wsequence-point]
   18 |       b[j++] = a[j];
      |         ~^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -