Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: robgornpeunpadpairoundnigumaipadnea

Problemset: Maximum Adjacent

Language: cpp

Time: 0.003 second

Submitted On: 2026-03-14 14:05:19

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    vector<int> v;
    while(true){
        string c;cin>>c;
        if((c >= "a" && c <= "z") ||(c>="A"&&c<="Z"))break;
        else {
            v.push_back(stoi(c));   
        }
    }  
    if(v[0] > v[1])cout << v[0]<<' ';
    for(int i=1;i<v.size()-1;i++){
        if(v[i] > v[i-1] && v[i] > v[i+1])cout<<v[i]<<' ';   
    }
    if(v[v.size()-1] > v[v.size()-2])cout << v[v.size()-1];
}