Last active
August 29, 2015 14:03
-
-
Save kuuso/593d2a0bba569f92b6d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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