Instantly share code, notes, and snippets.

Embed
What would you like to do?
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