Created
May 5, 2015 11:59
-
-
Save m4scosta/d0495199f0f0f9dc48e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <cstdlib> | |
using namespace std; | |
int main() | |
{ | |
int n, qt, s, ganhador, x; | |
vector<pair<int, int> > dist; | |
cin >> n; | |
while (n--) { | |
cin >> qt >> s; | |
dist.clear(); | |
for (int i = 0; i < 0; i++) { | |
cin >> x; | |
dist.push_back(make_pair(abs(x - s), i)); | |
} | |
sort(dist.begin(), dist.end()); | |
cout << dist[0].second << endl; | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment