Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#define NAX 1000
using namespace std;
int n,c[NAX],T[NAX+1];
int greedy(int);
void douteki(int);

int main(){
  int i,g,j,k,flag=0;

  k=1;
  while(1){
    flag=0;
    cin >> n;
    if(n == 0 )break;


    for(i=0;i<n;i++){
      cin >> c[i];
      if(i == 0 && c[i] != 1)flag=1; 
    }

    /**/
    if(n == 1 && c[i-1] == 1){
      cout << "Case #" << k << ": OK" << endl;
      k++;
      continue;
    }
    /*Èº©n=1, c=PÌCannot use greedy algorithmÆÈÁÄµÜÁÄ¢½ÌÅãÌæ¤ÉÂ¯½µ½çÊÁ½*/


    if(flag == 1){/*1ªÈ¢n_Åfâ1~ð¥¦È¢ÌÅ Cannot pay some amount*/
      cout << "Case #" << k << ": Cannot pay some amount" << endl;
      k++;
      continue;
    }
    else{
      // ÈºÌRgAEgÍ³µ­æÃ~@Æ®Ivæ@ÅÅ¬ÌRCðßévOª®ìµÄ¢é©ÌmFp
      //     for(j=1;j<=100;j++){    
      //    douteki(n);                                                             
      ///   cout << "greedy(" << j << ") =" << greedy(j) << endl;                       
      //   cout << "douteki("<< j << ")="<< T[j] << endl;
      // 	}
   
      
      douteki(n); @/*100000ñ®Ivæ@ÆæÃ~@ÅRCÌÅ¬ðß ®Ivæ@ < æÃ~@ ÆÈÁ½ç Cannot use greedy algorithm*/
		    for(j=1;j<=1000;j++){@/*½ª100000ñâçÈ­ÄàÇ¢ÆÍv¤@100ñ*/
	if(greedy(j) > T[j]){
	  flag=3;
	  break;
	}
      } 


    }                                                                      
      if(flag == 0){
        cout << "Case #" << k << ": OK" << endl;
   k++;
      }else{
        cout << "Case #" << k << ": Cannot use greedy algorithm" << endl;
        k++;
        }


    }


}




int greedy(int a){@/*æÃ~@*/
  int ans=0;
  for(int i = n-1;i>=0;i-- ){
    if(a >= c[i]){
      ans += a/c[i];
   a = a%c[i];
    }
  }
  return ans;

}


void douteki(int re){/*®Ivæ@ðp¢½RCÌÅ¬ðßévO*/
  for(int j = 0; j <= NAX ; j++)T[j]=10000;
  T[0] = 0;
 for(int i = 0; i < re ; i++){
    for(int j=c[i];j<=NAX;j++){
      T[j]= min(T[j],T[j-c[i]]+1);
    }
 }

}

Compiler output:
a.cc:48:19: error: extended character  is not valid in an identifier
   48 |       douteki(n); @/*100000ñ®Ivæ@ÆæÃ~@ÅRCÌÅ¬ðß ®Ivæ@ < æÃ~@ ÆÈÁ½ç Cannot use greedy algorithm*/
      |                   ^
a.cc:48:20: error: stray '@' in program
   48 |       douteki(n); @/*100000ñ®Ivæ@ÆæÃ~@ÅRCÌÅ¬ðß ®Ivæ@ < æÃ~@ ÆÈÁ½ç Cannot use greedy algorithm*/
      |                    ^
a.cc:49:42: error: extended character  is not valid in an identifier
   49 |                     for(j=1;j<=1000;j++){@/*½ª100000ñâçÈ­ÄàÇ¢ÆÍv¤@100ñ*/
      |                                          ^
a.cc:49:43: error: stray '@' in program
   49 |                     for(j=1;j<=1000;j++){@/*½ª100000ñâçÈ­ÄàÇ¢ÆÍv¤@100ñ*/
      |                                           ^
a.cc:75:19: error: extended character  is not valid in an identifier
   75 | int greedy(int a){@/*æÃ~@*/
      |                   ^
a.cc:75:20: error: stray '@' in program
   75 | int greedy(int a){@/*æÃ~@*/
      |                    ^
a.cc: In function 'int main()':
a.cc:48:19: error: '\302\201' was not declared in this scope
   48 |       douteki(n); @/*100000ñ®Ivæ@ÆæÃ~@ÅRCÌÅ¬ðß ®Ivæ@ < æÃ~@ ÆÈÁ½ç Cannot use greedy algorithm*/
      |                   ^
a.cc:49:40: error: expected ';' before ')' token
   49 |                     for(j=1;j<=1000;j++){@/*½ª100000ñâçÈ­ÄàÇ¢ÆÍv¤@100ñ*/
      |                                        ^
      |                                        ;
a.cc: In function 'int greedy(int)':
a.cc:75:19: error: '\302\201' was not declared in this scope
   75 | int greedy(int a){@/*æÃ~@*/
      |                   ^
a.cc:79:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   79 |       ans += a/c[i];
      |       ^~~
      |       abs
a.cc:83:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   83 |   return ans;
      |          ^~~
      |          abs