結果
問題 | No.313 π |
ユーザー |
![]() |
提出日時 | 2015-12-06 01:28:14 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 43 ms / 5,000 ms |
コード長 | 2,275 bytes |
コンパイル時間 | 939 ms |
コンパイル使用メモリ | 108,288 KB |
実行使用メモリ | 19,472 KB |
最終ジャッジ日時 | 2024-09-14 14:59:48 |
合計ジャッジ時間 | 3,457 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.IO; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ // 正解をゲットする bool gabagaba=false; if(gabagaba){ HttpWebRequest HttpWReq; Encoding enc = Encoding.UTF8; String url="http://www.geocities.jp/unko_der/sample_01.txt"; HttpWReq=(HttpWebRequest)WebRequest.Create(url); HttpWReq.Method="GET"; HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse(); Stream resStream = HttpWResp.GetResponseStream(); StreamReader sr = new StreamReader(resStream, enc); String html = sr.ReadToEnd(); sr.Close(); resStream.Close(); HttpWResp.Close(); var ca=html.ToCharArray(); ca[0]='3'; var PI0=new String(ca); for(int i=0;i<S.Length;i++){ if(S[i]!=PI0[i]){ Console.WriteLine("{0} {1}",S[i],PI0[i]); } } } Dictionary<char,int> D=new Dictionary<char,int>(); for(int i=0;i<S.Length;i++){ if(D.ContainsKey(S[i])==false)D.Add(S[i],0); D[S[i]]++; } var PI=new Dictionary<char,int>(){ {'3',20011}, {'.',1}, {'1',20063}, {'4',19874}, {'5',20199}, {'9',19841}, {'2',19892}, {'6',19898}, {'8',19956}, {'7',20163}, {'0',20104} }; char less='x'; char more='x'; foreach(var k in PI.Keys){ if(D[k]>PI[k])more=k; if(D[k]<PI[k])less=k; } Console.WriteLine("{0} {1}",more,less); } String S; public Sol(){ S=rs(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(){return Console.ReadLine().Split(' ');} static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }