Skip to content

Instantly share code, notes, and snippets.

@kuuso
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuuso/593d2a0bba569f92b6d7 to your computer and use it in GitHub Desktop.
Save kuuso/593d2a0bba569f92b6d7 to your computer and use it in GitHub Desktop.
END{while(++k<9)for(j=0;117>d=36+2*k*j++;)printf"%c",d}
#
#number of char 55
#number of multi count 17
#Point 990
using System;
using System.Collections;
using System.Collections.Generic;
class saiten{
//【文字数×(重複文字数+1)】ペナルティ
static void Main(){
String s="";
Dictionary<char,int> D=new Dictionary<char,int>();
int cnt=0;
Console.WriteLine("---Code---");
while((s=Console.ReadLine())!=null){
Console.WriteLine(s);
cnt+=s.Length;
for(int i=0;i<s.Length;i++){
if(!D.ContainsKey(s[i]))D.Add(s[i],0);
D[s[i]]++;
}
}
int mltcnt=0;
foreach(char c in D.Keys)mltcnt+=(D[c]-1);
Console.WriteLine("--Result--");
Console.WriteLine("number of char\t{0}",cnt);
Console.WriteLine("number of multi count\t{0}",mltcnt);
Console.WriteLine("Point\t{0}",cnt*(mltcnt+1));
Console.WriteLine("--table--");
foreach(char c in D.Keys)Console.WriteLine("{0}\t{1}",c,D[c]);
Console.WriteLine("---------");
Console.WriteLine("");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment