結果
問題 | No.313 π |
ユーザー |
![]() |
提出日時 | 2016-11-01 05:46:09 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 55 ms / 5,000 ms |
コード長 | 864 bytes |
コンパイル時間 | 727 ms |
コンパイル使用メモリ | 109,512 KB |
実行使用メモリ | 28,476 KB |
最終ジャッジ日時 | 2024-11-25 00:38:37 |
合計ジャッジ時間 | 4,331 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;class Magatro{static int[] cnt = new int[10];static void Main(){string s = Console.ReadLine();Counter(s);int n=0, m=0;int[] ans = { 20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841 };for(int i = 0; i < 10; i++){if (cnt[i] < ans[i]){n = i;}if (ans[i] < cnt[i]){m = i;}}Console.WriteLine("{0} {1}", m, n);}static void Counter(string s){for(int i = 0; i < 10; i++){string q = s;s = s.Replace(i.ToString(), "");cnt[i] = q.Length - s.Length;}}}