#include <bits/stdc++.h>
using namespace std;
long long x[1000000], y[1000000];
int main()
{
long long n, m, t, a, b, c, i, j, k, v, w, p, d, s, g;
scanf("%lld%lld%lld", &b, &a, &w);
for(i=2; i<=b; i++)
{
for(j=0; j<i; j++)
{
scanf("%lld", &n);
if((1+j)*(i-j)<=a && n<w)w=n;
}
}
printf("%lld\n", w);
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include <bits/stdc++.h> using namespace std; long long x[1000000], y[1000000]; int main() { long long n, m, t, a, b, c, i, j, k, v, w, p, d, s, g; scanf("%lld%lld%lld", &b, &a, &w); for(i=2; i<=b; i++) { for(j=0; j<i; j++) { scanf("%lld", &n); if((1+j)*(i-j)<=a && n<w)w=n; } } printf("%lld\n", w); return 0; } |
English