#include <bits/stdc++.h> using namespace std; typedef long long lld; typedef unsigned long long llu; typedef double lf; typedef long double llf; typedef pair<int,int> pii; #define pb push_back #define mp make_pair #define dd second #define ff first #define sz size() #define For(i,s,a) for(lld i=(lld)s;i<(lld)a;++i) int32_t main(void){ int a,b; scanf("%d%d", &a,&b); int wyn = 999999999, g; For(i,1,a+1){ For(j,1,i+1){ scanf("%d", &g); if(j * (i+1-j) <= b) wyn = min(wyn,g); } } printf("%d",wyn); }
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 26 27 28 29 | #include <bits/stdc++.h> using namespace std; typedef long long lld; typedef unsigned long long llu; typedef double lf; typedef long double llf; typedef pair<int,int> pii; #define pb push_back #define mp make_pair #define dd second #define ff first #define sz size() #define For(i,s,a) for(lld i=(lld)s;i<(lld)a;++i) int32_t main(void){ int a,b; scanf("%d%d", &a,&b); int wyn = 999999999, g; For(i,1,a+1){ For(j,1,i+1){ scanf("%d", &g); if(j * (i+1-j) <= b) wyn = min(wyn,g); } } printf("%d",wyn); } |