Skip to content

Commit

Permalink
Two nested loops
Browse files Browse the repository at this point in the history
  • Loading branch information
navkuun authored Mar 14, 2021
1 parent 4e0c5b8 commit 5b9dc71
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions BlackFriday.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define FOR(i,a,b) for(int i = a;i<b;i++)
#define INF (unsigned)!((int)0)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
const int NIL = -1; typedef pair<int, int> pii; typedef pair<ll, ll> pl;
typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vpii;
typedef vector<pl> vpl; typedef vector<vi> vvi; typedef vector<vl> vvl;
// kattis <blackfriday> question
void solve(){
}
int main () {
ios_base::sync_with_stdio(0);cin.tie(0);
int n; cin>>n;
int ans = -1 ;
int ind = -1;
int a[n];
for(int i =0; i<n;++i){
cin>>a[i];
}
bool sol; int temp;
for(int i =0 ;i<n;i++){
sol = true;
temp = a[i];
a[i] = 103;
for(int j = 0;j<n;++j){
if(temp == a[j]){
sol = false;
continue;
}
}
a[i] = temp;
if(sol){
if(a[i] > ans){
ans = a[i];
ind = i+1;
}
}
}

if(ans != -1)cout<<ind;
else cout<<"none";
return 0;
}




0 comments on commit 5b9dc71

Please sign in to comment.