add 3096 (conturi)
This commit is contained in:
parent
192f287b0d
commit
50bae9107f
1 changed files with 31 additions and 0 deletions
31
3098/solutie.cpp
Normal file
31
3098/solutie.cpp
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
ifstream fin("conturi.in");
|
||||||
|
ofstream fout("conturi.out");
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int n, x, m=0, cp, bani;
|
||||||
|
fin >> n >> x;
|
||||||
|
int v[n];
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
fin >> v[i];
|
||||||
|
}
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
cp = v[i];
|
||||||
|
bani = cp % 10000;
|
||||||
|
cp = cp / 10000;
|
||||||
|
if ((cp % 10) == 1) {
|
||||||
|
cp = cp / 10;
|
||||||
|
if ((cp % 10) == x) {
|
||||||
|
if (bani > m) {
|
||||||
|
m = bani;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fout << m;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue