Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define fastio ios::sync_with_stdio(false),cin.tie(0);
- #define pll pair<ll,ll>
- #define F first
- #define S second
- #define pb push_back
- #define ppb pop_back()
- #define mkp make_pair
- #define sz(a) (ll)a.size()
- #define all(x) x.begin(),x.end()
- const ll MAXN=1400000;
- const ll INF=1e18;
- const ll MOD=998244353;
- ll N;
- ll cnt[MAXN];
- ll arr[10010];
- void init(){
- cin>>N;
- for(ll i=1;i<=N;i++){
- cin>>arr[i];
- }
- for(ll i=1;i<=N;i++){
- for(ll j=i+1;j<=N;j++){
- ll m=arr[i]+arr[j];
- if(m%2==0){
- m/=2;
- if(cnt[m]!=0){
- cout<<"Yes\n";
- cout<<i<<" "<<cnt[m]<<" "<<j<<'\n';
- return;
- }
- }
- cnt[arr[j]]=j;
- }
- for(ll j=i+1;j<=N;j++){
- cnt[arr[j]]=0;
- }
- }
- cout<<"No\n";
- }
- void solve(){
- }
- signed main(){
- fastio
- freopen("injurious.in","r",stdin);
- freopen("injurious.out","w",stdout);
- // ll T;
- // cin>>T;
- // while(T--){
- init();
- solve();
- // }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement