stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <cstdio>

#include <vector>

#include <algorithm>

#include <map>

#include <queue>

#include <functional>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> pii;



#define fst first

#define scd second

#define PB push_back

#define rep(i,x) for(ll i=0;i<(x);++i)



const ll linf = 3e18;



struct edge {

	ll to, cost;

	edge(ll to, ll cost = linf) : to(to), cost(cost) {}

};



ll N, M, C;



ll d[100000];

vector<edge> G[100000];

map<ll, vector<ll> >  m;

bool found[100000];

map<ll, bool> used[100000];



void dijkstra(ll s)

{

	priority_queue<pii, vector<pii>, greater<pii> > q;

	fill(d, d + N, linf);

	d[s] = 0;

	q.push(pii(0, s));

	while (q.size()) {

		pii p = q.top(); q.pop();

		ll v = p.scd;

		if (d[v] < p.fst) continue;

		rep(i, G[v].size()) {

			edge e = G[v][i];

			if (d[e.to] > d[v] + e.cost) {

				d[e.to] = d[v] + e.cost;

				m[d[e.to]].PB(e.to);

				q.push(pii(d[e.to], e.to));

			}

		}

	}

}



signed main()

{

	scanf("%lld %lld %lld", &N, &M, &C);



	ll sum = 0;



	rep(i, M) {

		ll A, B, D; scanf("%lld %lld %lld", &A, &B, &D), A--, B--;

		G[A].PB(edge(B, D));

		G[B].PB(edge(A, D));

		sum += D;

	}



	dijkstra(0);

	found[0] = true;



	ll mi = linf;



	m[0] = vector<ll>();



	for (map<ll, vector<ll> >::iterator itr = m.begin(); itr != m.end(); ++itr) {

		ll X = itr->fst;

		vector<ll> vs = itr->scd;



		rep(i, vs.size()) found[vs[i]] = true;



		rep(i, vs.size()) {

			ll v = vs[i];

			rep(j, G[v].size()) {

				edge e = G[v][j];

				if (!found[e.to]) continue;

				if (used[v][e.to]) continue;

				used[v][e.to] = used[e.to][v] = true;

				sum -= e.cost;

			}

		}



		mi = min(mi, sum + C * X);

	}



	printf("%lld\n", mi);

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;



#define int long long



#define rep(i,x) for(int i=0;i<x;++i)



#define fst first

#define scd second





using vi=vector<int>;

using pii=pair<int,int>;

using vpii=vector<pii>;

//using data=pair<pii, int>;



const int inf = 3e18;



struct edge{int to,cost;};

vector<edge> G[100010];

int d[100010];

bool used[100010];



int n, m, c;



signed main()

{

	cin >> n >> m >> c;

	

	int sum = 0;

	

	rep(i, m) {

		int a, b, d; cin >> a >> b >> d;

		--a, --b;

		G[a].push_back(edge{b, d});

		G[b].push_back(edge{a, d});

		

		sum += d;

	}

	

	priority_queue<pii, vector<pii>, greater<pii>> q;

	q.push(pii(0, 0));

	

	fill_n(d, n+1, inf);

	d[0] = 0;

	

	int ans = inf;

	

	while (q.size()) {

		pii p = q.top(); q.pop();

		

		if (d[p.scd] == p.fst) {

			used[p.scd] = true;

			

			for (edge &e : G[p.scd]) {

				if (used[e.to]) sum -= e.cost;

			}

			

			ans = min(ans, p.fst * c + sum);

		}

		

		if (d[p.scd] < p.fst) {

			continue;

		}

		

		for (edge &e : G[p.scd]) {

			if (d[e.to] > d[p.scd] + e.cost) {

				d[e.to] = d[p.scd] + e.cost;

				q.push(pii(d[e.to], e.to));

			}

		}

	}

	

	cout << ans << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <vector>

#include <algorithm>

#include <map>

#include <queue>

#include <functional>



using namespace std;



typedef long long ll;

typedef pair<int, int> pii;



#define fst first

#define scd second

#define PB push_back

#define rep(i,x) for(int i=0;i<(x);++i)



const ll inf = 3e18;



struct edge {

	int to, cost;

	edge(int to, int cost) : to(to), cost(cost) {}

};



int N, M, C;



ll d[100000];

vector<edge> G[100000];

map<ll, vector<int> >  m;

bool found[100000];

map<int, bool> used[100000];



void dijkstra(int s)

{

	priority_queue<pii, vector<pii>, greater<pii> > q;

	fill(d, d + N, inf);

	d[s] = 0;

	q.push(pii(0, s));

	while (q.size()) {

		pii p = q.top(); q.pop();

		int v = p.scd;

		if (d[v] < p.fst) continue;

		rep(i, G[v].size()) {

			edge e = G[v][i];

			if (d[e.to] > d[v] + e.cost) {

				d[e.to] = d[v] + e.cost;

				m[d[e.to]].PB(e.to);

				q.push(pii(d[e.to], e.to));

			}

		}

	}

}



signed main()

{

	scanf("%d %d %d", &N, &M, &C);



	ll sum = 0;



	rep(i, M) {

		int A, B, D; scanf("%d %d %d", &A, &B, &D), A--, B--;

		G[A].PB(edge(B, D));

		G[B].PB(edge(A, D));

		sum += D;

	}



	dijkstra(0);

	found[0] = true;



	ll mi = inf;



	m[0] = vector<int>();



	for (map<ll, vector<int> >::iterator itr = m.begin(); itr != m.end(); ++itr) {

		ll X = itr->fst;

		vector<int> vs = itr->scd;



		rep(i, vs.size()) found[vs[i]] = true;



		rep(i, vs.size()) {

			int v = vs[i];

			rep(j, G[v].size()) {

				edge e = G[v][j];

				if (!found[e.to]) continue;

				if (used[v][e.to]) continue;

				used[v][e.to] = used[e.to][v] = true;

				sum -= e.cost;

			}

		}



		mi = min(mi, sum + C * X);

	}



	printf("%lld\n", mi);

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;



#define int long long



#define rep(i,x) for(int i=0;i<x;++i)



#define fst first

#define scd second





using vi=vector<int>;

using pii=pair<int,int>;

using vpii=vector<pii>;

//using data=pair<pii, int>;



const int inf = 3e18;



struct edge{int to,cost;};

vector<edge> G[100010];

int d[100010];

bool used[100010];



int n, m, c;



signed main()

{

	cin >> n >> m >> c;

	

	int sum = 0;

	

	rep(i, m) {

		int a, b, d; cin >> a >> b >> d;

		--a, --b;

		G[a].push_back(edge{b, d});

		G[b].push_back(edge{a, d});

		

		sum += d;

	}

	

	priority_queue<pii, vector<pii>, greater<pii>> q;

	q.push(pii(0, 0));

	

	fill_n(d, n+1, inf);

	d[0] = 0;

	

	int ans = inf;

	

	while (q.size()) {

		pii p = q.top(); q.pop();

		

		if (d[p.scd] == p.fst) {

			used[p.scd] = true;

			

			for (edge &e : G[p.scd]) {

				if (used[e.to]) sum -= e.cost;

			}

			

			ans = min(ans, p.fst * c + sum);

		}

		

		if (d[p.scd] < p.fst) {

			continue;

		}

		

		for (edge &e : G[p.scd]) {

			if (d[e.to] > d[p.scd] + e.cost) {

				d[e.to] = d[p.scd] + e.cost;

				q.push(pii(d[e.to], e.to));

			}

		}

	}

	

	cout << ans << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <sstream>

#include <iomanip>

#include <algorithm>

#include <cmath>

#include <string>

#include <vector>

#include <list>

#include <queue>

#include <stack>

#include <set>

#include <map>

#include <bitset>

#include <numeric>

#include <climits>

#include <cfloat>

using namespace std;



int n;

vector<int> w, s;

vector<bool> used;

vector<int> bestIndex;

int bestG;



void solve(int k, vector<int>& index, int g, int sumW)

{

    if(k == n){

        if(g < bestG){

            bestG = g;

            bestIndex = index;

        }

        return;

    }



    for(int i=0; i<n; ++i){

        if(used[i])

            continue;

        used[i] = true;

        if(s[i] >= sumW){

            index[k] = i;

            solve(k+1, index, g+(n-k)*w[i], sumW+w[i]);

        }

        used[i] = false;

    }

}



int main()

{

    for(;;){

        cin >> n;

        if(n == 0)

            return 0;



        vector<string> name(n);

        w.resize(n);

        s.resize(n);

        for(int i=0; i<n; ++i)

            cin >> name[i] >> w[i] >> s[i];



        bestG = INT_MAX;

        used.assign(n, false);

        vector<int> index(n);

        solve(0, index, 0, 0);

        for(int i=n-1; i>=0; --i)

            cout << name[bestIndex[i]] << endl;

    }

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <sstream>

#include <iomanip>

#include <algorithm>

#include <cmath>

#include <string>

#include <vector>

#include <list>

#include <queue>

#include <stack>

#include <set>

#include <map>

#include <bitset>

#include <numeric>

#include <climits>

#include <cfloat>

using namespace std;



class Data

{

public:

    int w, s;

    string name;

    bool operator<(const Data& d) const{

        return s < d.s;

    }

};



int n;

vector<Data> d;

vector<bool> used;

vector<int> bestIndex;

int bestG;



void solve(int k, vector<int>& index, int g, int sumW)

{

    if(k == n){

        if(g < bestG){

            bestG = g;

            bestIndex = index;

        }

        return;

    }



    for(int i=0; i<n; ++i){

        if(used[i])

            continue;

        if(d[i].s >= sumW){

            used[i] = true;

            index[k] = i;

            solve(k+1, index, g+(n-k)*d[i].w, sumW+d[i].w);

            used[i] = false;

        }else{

            return;

        }

    }

}



int main()

{

    for(;;){

        cin >> n;

        if(n == 0)

            return 0;



        d.resize(n);

        for(int i=0; i<n; ++i)

            cin >> d[i].name >> d[i].w >> d[i].s;

        sort(d.begin(), d.end());



        bestG = INT_MAX;

        used.assign(n, false);

        vector<int> index(n);

        solve(0, index, 0, 0);

        for(int i=n-1; i>=0; --i)

            cout << d[bestIndex[i]].name << endl;

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cfloat>

using namespace std;



char f[10][21];

int n, w[10], s[10], a[10], b[10];

bool u[10];

double maxg;



void dfs(int x, int tw, int m, double g) {

  if (m == n) {

    if (maxg < g) {

      maxg = g;

      for (int i=0; i<n; i++) {

        b[i] = a[i];

      }

    }

    return;

  }

  if (x>=n) {

    return;

  }

  if (!u[x] && tw <= s[x]) {

    u[x] = true;

    tw += w[x];

    a[m] = x;

    dfs(0, tw, m+1, g + w[x]*(m+1));

    tw -= w[x];

    u[x] = false;

  }

  dfs(x+1, tw, m, g);

}



int main() {

  while (1) {

    scanf("%d", &n);

    if (!n) break;

    for (int i=0; i<n; i++) {

      scanf("%s %d %d", f[i], &w[i], &s[i]);

    }

    for (int i=0; i<n; i++) {

      u[i] = false;

    }

    maxg = -DBL_MAX;

    dfs(0, 0, 0, 0.);

    for (int i=n-1; i>=0; i--) {

      printf("%s\n", f[b[i]]);

    }

  }

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;



struct C {

  int id;

  int w;

  int s;

  static bool compare(const C &l, const C &r) {

    if (l.w > r.w) {

      return true;

    } else if (l.w < r.w) {

      return false;

    } else {

      return (l.s > r.s);

    }

  }

};



int main() {

  C c[10];

  char f[10][21];

  int n, tw, a[10];

  bool u[10];

  while (1) {

    scanf("%d", &n);

    if (!n) break;

    for (int i=0; i<n; i++) {

      c[i].id = i;

      scanf("%s %d %d", f[i], &c[i].w, &c[i].s);

    }

    sort(c, c+n, C::compare);

    tw = 0;

    for (int i=0; i<n; i++) {

      tw += c[i].w;

    }

    for (int i=0; i<n; i++) {

      u[i] = false;

    }

    for (int i=0; i<n; i++) {

      for (int j=0; j<n; j++) {

        if (!u[j] && tw - c[j].w <= c[j].s) {

          tw -= c[j].w;

          a[i] = c[j].id;

          u[j] = true;

          break;

        }

      }

    }

    for (int i=0; i<n; i++) {

      printf("%s\n", f[a[i]]);

    }

  }

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <sstream>

#include <string>

#include <algorithm>

using namespace std;



template <class F, class T>

void convert(const F &f, T &t){

	stringstream ss;

	ss << f;

	ss >> t;

}



int main(){

	int x, a, b;

	string s;

	while(scanf("%d", &x), x){

		if(x % 1111 == 0){

			puts("NA");

		}

		else{

			int ans;

			for(ans = 0; x != 6174; ++ans){

				convert(x, s);

				s.resize(4, '0');

				sort(s.begin(), s.end());

				convert(s, a);

				reverse(s.begin(), s.end());

				convert(s, b);

				x = b - a;

			}

			printf("%d\n", ans);

		}

	}

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

#include <cstdlib>

#include <climits>

using namespace std;



int ans[10010];

char tmp[8];



int dfs(int x){

	if(ans[x] >= 0){

		return ans[x];

	}

	if(ans[x] != -1){

		return INT_MIN;

	}

	ans[x] = INT_MIN;



	sprintf(tmp, "%04d", x);

	sort(tmp, tmp + 4);

	int b = strtol(tmp, 0, 10);

	reverse(tmp, tmp + 4);

	int a = strtol(tmp, 0, 10);

	ans[x] = dfs(a - b) + 1;

	return ans[x];

}





int main(){

	for(int i = 0; i < 10005; ++i){

		ans[i] = -1;

	}

	ans[6174] = 0;



	int n;

	while(scanf("%d", &n), n){

		int a = dfs(n);

		printf(a < 0 ? "NA\n" : "%d\n", a);

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define pb push_back

#define rep(i,n) for(int i=0;i<n;i++)

#define rep1(i,n) for(int i=1;i<=n;i++)

#define mp make_pair

#define F first

#define S second

#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

typedef long long ll;

vector<int> g[100005];

ll q,n;

ll a[1500005];

int main()

{

    //IOS;

    ll x,y;

    while(cin>>x>>y)

    {

        ll sum=0;

        for(sum=0;x<=y;x=x*2,sum++);

        cout<<sum<<"\n";

    }

    return 0;

}




// Optimized solution to the same problem (faster):
#include <iostream>

using namespace std;

int main() {

   long long x,y,answer=0;

   cin>>x>>y;

   for(long long i=x;i<=y;i*=2)

   answer++;

   cout<<answer;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<algorithm>

using namespace std;



long long read(){

    long long x=0,f=1;

    char ch;

    do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');

    do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');

    return x*f;

}



long long x,y,ans=0;

int main(){

    x=read();

    y=read();

    while(x<=y){

        ans++;

        x*=2;

    }

    printf("%lld\n",ans);

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

long long x,y,res;

int main()

{

	scanf("%lld%lld",&x,&y,&res);

	long long i=x;

	while(i<=y)

	{

		res++;

		i<<=1;

	}

	printf("%d\n",res);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

long long x,y,ans,sum;

int main(){   

    cin>>x>>y;

    ans=(y/x);

    while(ans)ans/=2,sum++;

    cout<<sum;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

long long x,y,res;

int main()

{

	scanf("%lld%lld",&x,&y,&res);

	long long i=x;

	while(i<=y)

	{

		res++;

		i<<=1;

	}

	printf("%d\n",res);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main()

{

    long long int a,b;

    long long int res=0;

    cin>>a>>b;

    while(a<=b)

    {

        a=a*2;

        res++;

    }

    cout<<res<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>





int main()

{	 

	long long x, y;

	int ans = 0;

	

	scanf("%lld%lld", &x, &y);

	while(x <= y){

		ans++;

		x <<= 1;

	}

	printf("%d\n", ans);	

		

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main() {

    long long x, y;

    cin >> x >> y;

    int res = 0;

    for (long long i = x; i <= y; i *= 2) {

        res++;

    }

    cout << res;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>





int main()

{	 

	long long x, y;

	int ans = 0;

	

	scanf("%lld%lld", &x, &y);

	while(x <= y){

		ans++;

		x <<= 1;

	}

	printf("%d\n", ans);	

		

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define mp make_pair

#define X first

#define Y second

#define pii pair<ll,ll>

#define x1 dlfjl

#define x2 dkfj

#define x3 dflgkg

#define y1 dskgj

#define y2 dskfj

#define y3 dfhgdh

#define SQ 320

#define PI 3.14159265359

#define MOD 1000000007

typedef int ll;

using namespace std;

ll n,i,j,k,z,m,q,r,timer,v,tot,x,y,xx, yy,INF, sz;

ll a[100500], cnt[100500], col[100500];

ll dp[105][105][105];

void ass(ll i, ll j, ll k, ll val) {

    dp[i][j][k] = dp[i][k][j] = dp[j][i][k] = dp[j][k][i] = dp[k][i][j] = dp[k][j][i] = val;

}

bool ss(ll x, ll y) {

    if (min(x,y) == 0 && (x != 0 || y != 0))

        return false;

    return true;

}

int main() {

    //freopen("input.txt","r",stdin);

    cin >> n;

    for (int i = 0; i < n; i++)

        cin >> a[i];

    sort(a, a+n);

    reverse(a, a+n);

    int i = 0, j = 0;

    while (i+1 < n && j+1 < a[i+1])

        i++, j++;

        ll x = a[i]-j;

        ll y = 0;

        while (i+1 < n && j < a[i+1])

            y++, i++;

        //cout << x << " " << y << endl;

        if (x%2 && y % 2 == 0)

            cout << "Second" << endl;

        else

            cout << "First" << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<functional>

using namespace std;

int n,a[110000];

int main(){

    scanf("%d",&n);

    for (int i=1;i<=n;i++) scanf("%d",&a[i]);

    sort(a+1,a+n+1,greater<int>());

    a[0]=a[1];

    for (int i=0;i<=n;i++)

        if (a[i+1]<=i){

            int j=i+1;

            while (j<=n&&a[j]==i) j++;

            if ((j-i+1)&1||(a[i]-i)&1) puts("First");

            else puts("Second");

            break;

        } 

    return 0;

}

//atcoder 1999

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

const int maxn=100000+10;

int n,a[maxn],ans;

bool cmp(int a,int b){return a>b;}



int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

		scanf("%d",&a[i]);

	sort(a+1,a+n+1,cmp);

	for(int i=1;i<=n;i++){

		if(i+1>a[i+1]){

			for(int j=i+1;a[j]==i;j++)

				ans^=1;

			ans|=(a[i]-i)&1;

			if(ans&1) printf("First\n");

			else printf("Second\n");

			return 0;

		}

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<functional>

using namespace std;

int n,a[110000];

int main(){

    scanf("%d",&n);

    for (int i=1;i<=n;i++) scanf("%d",&a[i]);

    sort(a+1,a+n+1,greater<int>());

    a[0]=a[1];

    for (int i=0;i<=n;i++)

        if (a[i+1]<=i){

            int j=i+1;

            while (j<=n&&a[j]==i) j++;

            if ((j-i+1)&1||(a[i]-i)&1) puts("First");

            else puts("Second");

            break;

        } 

    return 0;

}

//atcoder 1999

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define res register int

#define N 100005

using namespace std;

int n,ans,a[100100];

inline int read()

{

  int X=0,w=0;

  char ch=0;

  while(!isdigit(ch))

  {

    w|=ch=='-';

    ch=getchar();

  }

  while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();

  return w?-X:X;

}

inline bool cmp(int x,int y)

{

  return x>y;

}

int main()

{

  n=read();

  for(res i=1; i<=n; i++)

    a[i]=read();

  sort(a+1,a+n+1,cmp);

  for(res i=1; i<=n; i++)

    if(i+1>a[i+1])

    {

      for(res j=i+1; a[j]==i; j++) ans^=1;

      ans|=(a[i]-i)&1;

      puts(ans? "First":"Second");

      return 0;

    }

  return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<functional>

using namespace std;

int n,a[110000];

int main(){

    scanf("%d",&n);

    for (int i=1;i<=n;i++) scanf("%d",&a[i]);

    sort(a+1,a+n+1,greater<int>());

    a[0]=a[1];

    for (int i=0;i<=n;i++)

        if (a[i+1]<=i){

            int j=i+1;

            while (j<=n&&a[j]==i) j++;

            if ((j-i+1)&1||(a[i]-i)&1) puts("First");

            else puts("Second");

            break;

        } 

    return 0;

}

//atcoder 1999

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cstring>

#include <iostream>

#include <algorithm>

using namespace std;

#define N 100005

int A[N], n;

bool cmp(int a, int b){return a > b;}

int main()

{

	scanf("%d", &n);

	for (int i = 1; i <= n; i++)

		scanf("%d", &A[i]);

	sort(A + 1, A + n + 1, cmp);

	for (int i = 1; i <= n; i++)

	{

		if (i <= A[i] && A[i + 1] < i + 1)

		{

			int j = 0;

			while (A[i + j + 1] == i)

				j++;

			if ((A[i] - i) % 2 == 0 && j % 2 == 0)

				puts("Second");

			else

				puts("First");

			return 0;

		}

	}

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<functional>

using namespace std;

int n,a[110000];

int main(){

    scanf("%d",&n);

    for (int i=1;i<=n;i++) scanf("%d",&a[i]);

    sort(a+1,a+n+1,greater<int>());

    a[0]=a[1];

    for (int i=0;i<=n;i++)

        if (a[i+1]<=i){

            int j=i+1;

            while (j<=n&&a[j]==i) j++;

            if ((j-i+1)&1||(a[i]-i)&1) puts("First");

            else puts("Second");

            break;

        } 

    return 0;

}

//atcoder 1999

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <vector>

#include <list>

#include <map>

#include <set>

#include <deque>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <utility>

#include <sstream>

#include <iostream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <ctime>

#include <memory.h>



using namespace std;



int n, ar[1000001];



int main()

{

    cin >> n;

    for(int i = 1; i <= n; i++)

        scanf("%d", &ar[i]);



    sort(ar + 1, ar + n + 1, greater<int>());



    int a = 1, b = 1;

    while(ar[b] >= a)

    {

        b++;

        a++;

    }

    b--;

    a--;



    int t1 = 1, t2 = 1;



    if((ar[b] - a) % 2 == 1)

        t1 = 0;



    int q = 0;

    for(int i = 1; i <= n; i++)

        if(ar[i] >= a)

            q++;



    if((q - a) % 2 == 1)

        t2 = 0;



    if(t2 + t1 != 2)

    {

        cout << "First" << endl;

    }else

    {

        cout << "Second" << endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

int n,ans,a[100100];

int main(){

    scanf("%d",&n);

    for(int i=1;i<=n;i++) scanf("%d",&a[i]);

    sort(a+1,a+n+1);

    reverse(a+1,a+n+1);

    for(int i=1;i<=n;i++){

        if(i+1>a[i+1]){

               for(int j=i+1;a[j]==i;j++) ans^=1;

               ans|=(a[i]-i)&1;

               puts(ans? "First":"Second");

               return 0;

           }    

    }    

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
//#pragma GCC optimize("O3")

#include <bits/stdc++.h>



using namespace std;



typedef long long ll;



const int N = 1e5 + 5;

const int mod = (int) 1e9 + 7;



int n, a[N];



inline void solve () {

        scanf ("%d", &n);

        for (int i = 1; i <= n; i++) {

                scanf ("%d", &a[i]);

        }

        sort (a + 1, a + n + 1, greater<int> ());

        int f = n, x = 0;

        for (int i = 1; i <= n; i++) {

                if (a[i] < i) {

                        f = i - 1;

                        break;

                }

        }

        for (int i = 1; i <= n; i++) {

                if (a[i] >= f) {

                        x++;

                }

        }

        puts (((x - f) | (a[f] - f)) % 2 ? "First" : "Second");

}



int tests = 1;



int main () {

//        freopen (".in", "r", stdin);

//        freopen (".out", "w", stdout);

//        scanf ("%d", &tests);

        while (tests--) {

                solve ();

        }

        return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

int n,ans,a[100100];

int main(){

    scanf("%d",&n);

    for(int i=1;i<=n;i++) scanf("%d",&a[i]);

    sort(a+1,a+n+1);

    reverse(a+1,a+n+1);

    for(int i=1;i<=n;i++){

        if(i+1>a[i+1]){

               for(int j=i+1;a[j]==i;j++) ans^=1;

               ans|=(a[i]-i)&1;

               puts(ans? "First":"Second");

               return 0;

           }    

    }    

}

// Fastest known solution for this problem: