764B - Timofey and cubes - CodeForces Solution


constructive algorithms implementation *900

Please click on ads to support us..

C++ Code:

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int a[200100];
int main() {
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    for(int i=1;i<=n/2;i=i+2){
                swap(a[i],a[n-i+1]);
            }

    for(int i=1;i<=n;i++){
        cout<<a[i]<<" ";
    }
    cout<<endl;
        return 0;
}
 
 


Comments

Submit
0 Comments
More Questions

AND path in a binary tree
Factorial equations
Removal of vertices
Happy segments
Cyclic shifts
Zoos
Build a graph
Almost correct bracket sequence
Count of integers
Differences of the permutations
Doctor's Secret
Back to School
I am Easy
Teddy and Tweety
Partitioning binary strings
Special sets
Smallest chosen word
Going to office
Color the boxes
Missing numbers
Maximum sum
13 Reasons Why
Friend's Relationship
Health of a person
Divisibility
A. Movement
Numbers in a matrix
Sequences
Split houses
Divisible