A- #include<iostream>
- #include <stdlib.h>
- #define SWAP(x,y) {int t; t = x; x = y; y = t;}
- using namespace std;
- void quickSort(int[], int, int);
- int main(){
- int a,i;
- cin>>a;
- while(a){
- a--;
- int b,c;
- cin>>b>>c;
- int d[b];
- for(i=0;i<b;i++)
- cin>>d[i];
- quickSort(d,0,b-1);
- bool isB=false;
- for(i=0;i<b;i++){
- if(d[i]>=c){
- isB=true;
- break;
- }
- }
- if(isB)
- cout<<i*50+50<<endl;
- else
- cout<<"not yet"<<endl;
- }
- return 0;
- }
- void quickSort(int number[], int left, int right) { if(left < right) { int i = left; int j = right + 1; while(1) { while(i + 1 < right+1 && number[++i] < number[left]) ; while(j -1 > -1 && number[--j] > number[left]) ; if(i >= j) break; SWAP(number[i], number[j]); } SWAP(number[left], number[j]); quickSort(number, left, j-1); quickSort(number, j+1, right); } }
複製代碼 |