Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int length;
vector<int> rn;
double dp[1 << 12 + 1][12];

const int INF = 1000000;

// nÌrbgª§ÁÄ¢éª»Ý ÉüÁÄ¢é~
// nÌóÔ©ç½ÇèÂ¯éÅ¬Ì·³ðßé
void solve(){

  for(int i = 0; i < 1 << rn.size(); i++){
    fill(dp[i],dp[i]+12,INF);
  }

  for(int i = 0; i < rn.size(); i++){
    dp[1<<i][i] = 2*rn[i];
  }

  for(int s = 1; s < 1 << rn.size(); s++){
    for(int j = 0; j < rn.size(); j++){
      if((s >> j & 1) == 0){
	continue;
      }
      for(int i = 0; i < rn.size(); i++){
	if((s >> i) & 1 == 0){
	  dp[s|1<<i][i] = min(dp[s|1<<i][i]
			      ,dp[s][j] + 2*sqrt(rn[j]+rn[i])-rn[j]+rn[i]);
	}
      }
    }
  }
  double minNum = INF;
  for(int i = 0; i < rn.size(); i++){
    minNum = min(minNum,dp[(1<<rn.size())-1][i]);
  }
  if(minNum < (double)length){
    cout << "OK" << endl;
  }
  else
    cout << "NA" << endl;
}

int main(){
  int n;

  string str;
  while(1){
    //    fill(dp,dp+1<<12,-1);
    rn.clear();
    getline(cin,str);
    if(cin.eof())
      break;
    bool flag = true;
    string s;
    for(int i = 0; i < str.size(); i++){
      if(str[i] == ' '){
	if(flag){
	  length = atoi(s.c_str());
	  flag = false;
	}
	else{
	  rn.push_back(atoi(s.c_str()));
	}
	s = "";
      }
      else if(i == str.size()-1){
	s += str[i];
	rn.push_back(atoi(s.c_str()));
      }
      else
	s += str[i];
    }

    solve();
    // cout << length << " " << flush;
    // for(int i = 0; i < rn.size(); i++){
    //   cout << rn[i] << " " << flush;
    // }
    // cout << endl;
  }
  
  return 0;
}PAA=

Compiler output:
a.cc:91:2: warning: null character(s) ignored
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |  ^~~~~~~~
a.cc:91:60: error: stray '\6' in program
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^~~~~~~~
a.cc:91:61: warning: null character(s) ignored
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^~~~~~~~
a.cc:91:66: error: stray '\32' in program
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^~~~~~~~
a.cc:91:68: error: stray '\10' in program
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ^~~~~~~~
a.cc:91:69: error: stray '\35' in program
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^~~~~~~~
a.cc:91:71: error: stray '\35' in program
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^~~~~~~~
a.cc:91:72: warning: null character(s) ignored
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ^~~~~~~~
a.cc:91:74: error: stray '\1' in program
   91 | }<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0006><U+0000><U+0000><U+0000>PA<U+001A>A<U+0008><U+001D>=<U+001D><U+0000><U+0000><U+0001><U+0000><U+000