Submission

Status:

PP-PPPPPP-

Subtask/Task Score:

80/100

Score: 80

User: iAOMNC

Problemset: Maximum Adjacent

Language: cpp

Time: 0.003 second

Submitted On: 2025-11-10 11:21:19

#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int> a;
a.push_back(0);
int i=0;
string b;
while(1>0)
{
cin >> b;

if(b[0]>='a')
{
break;
}
else
{
int k=stoi(b);
a.push_back(k);
}
i++;
}
a.push_back(0);
for(int y=1;y<i;y++)
{
if(a[y+1]<a[y]&&a[y-1]<a[y])
{
cout << a[y]<<" ";
}
}

}