题解
2025-06-02 22:09:24
发布于:广东
20阅读
0回复
0点赞
# include <bits/stdc++.h>
typedef unsigned long long ull;
#define getchar getchar_unlocked()
#define psbc push_back
#define v vector
#define for1 for(i = 0;i<n;i++)
#define be(x) x.begin(),x.end()
using namespace std ;
const int MX = 1e5;
int i,j,k;
int r(){
int x = 0,f = 1;
char c = getchar;
while(c<'0'||c>'9'){if(c=='-') f = -1;c = getchar;}
while(c>='0'&&c<='9') x = (x<<1)+(x<<3)+(c^(3<<4)),c = getchar;
return x*f;
}
int main ( )
{
int t = r();
while(t--){
int n = r(),m = r(),x;
ull sum = 0;
bool f = 1;
for(i = 0;i<n;i++){
x = r();
sum += x;
if(x>=m){
f = 0;
}
}
double avg = sum*1.0/n;
if(f){
cout<<"OK!";
}
else{
cout<<"TLE!";
}
printf("\n%.3f\n",avg);
}
return 0;
}
这里空空如也
有帮助,赞一个