ï¼ç¤¾å ã¨ã³ã¸ãã¢ããã®å¯ç¨¿ã§ãï¼
PG BATTLE ã¨ã¯
3人1çµã§åå ããããã°ã©ãã³ã°ã³ã³ãã¹ãã§ãããããã競æããã°ã©ãã³ã°ã®å½¢å¼ã§ãåºé¡ãããåé¡ãæéå ã«è§£ãã¦æåºãã¾ãã
- ããã°ã©ãã³ã°ã«å¯¾ããè©ä¾¡åä¸
- é½ã®å½ããæ©ä¼ã®æä¾
- èªåã®å®åãç¥ãæ©ä¼
- åç´ã«æ¥½ãã
ã®4ã¤ãæ±ã¨ãã¦æ²ãã¦ãããããã°ã©ãã³ã°ã«èªä¿¡ã®ããæ¹ã¯ãã¡ãããèªä¿¡ã®ãªãæ¹ãæé·ã®æ©ä¼ã«ç¹ããã®ã§ã¯ãªããã¨æãã¾ãã
ããã¾ã§ã«6åéå¬ããã¦ãããæ¯å¹´400ãã¼ã è¿ãã¨ã³ããªã¼ãããã¾ããå¼ç¤¾ããã¯ããã¾ã§åå ãããã¨ã¯ããã¾ããã§ããããä¸é·ã«ãèä¸ãæ¼ãããååå ãããã¨ã¨ãªãã¾ããã
ç·´ç¿ã«ã¤ãã¦
ã³ã³ãã¹ãã§æ´»èºããæ°æºã ã®ç§ã¯ãéå¬ã¾ã§ä¸ãæã»ã©ãããªãã£ããã¨ããããã¨ã³ããªã¼ã決ãã¦ããããã«ç·´ç¿ãéå§ãã¾ããã
ç·´ç¿ã«ããã£ã¦ã Visual Studio 㧠C# ã®ç°å¢ãä½æãã¾ããã®ã§ããããç´¹ä»ãã¾ãã
å®éã«ã³ã¼ããå®è¡ãã¦æå¦ã確èªã§ããããã«ããããããã¹ãããã¸ã§ã¯ãã使ç¨ãã¾ããã
ããã¸ã§ã¯ããä½æããããã®ç¶æ ã¯ç»é¢ã®ããã«ãªã£ã¦ãã¾ããããã«è§£çã®ã³ã¼ãã¨ã確èªç¨ã®ã³ã¼ããæ¸ãã¦ããã¾ãã
å®éã«æ¸ããã³ã¼ãã¯ä»¥ä¸ã®éãã§ãã(å ¥åºåä¾2,3 ã¯çç¥) PG BATTLE 2023 ã®éå»å ã¾ãã ã¾ãã®1åç® ã解ãããã®ã«ãªãã¾ãã
using System.Text; namespace PGB2023 { [TestClass] public class UnitTest1 { /// <summary> /// å ¥åºåä¾1 /// </summary> [TestMethod] public void TestMethod1() { StringBuilder inputText = new(); StringBuilder outputText = new(); inputText.AppendLine("1"); outputText.AppendLine("0.5000000000"); using var input = new StringReader(inputText.ToString()); using var output = new StringWriter(); Console.SetIn(input); Console.SetOut(output); Program(); Assert.AreEqual(outputText.ToString(), output.ToString()); } /// <summary> /// 解ç /// </summary> private static void Program() { List<string[]> inputs = []; while (Console.ReadLine() is string line) { inputs.Add(line.Split(" ")); } int n = int.Parse(inputs[0][0]); double result = Math.Pow(0.5, n); Console.WriteLine(result.ToString("F10")); } } }
ããã¾ã§æ¸ããç¶æ ã§ããã¹ããå®è¡ããã¨ããã¹ãã¨ã¯ã¹ããã¼ã©ã¼ä¸ã«æå¦ã表示ã¾ãã¾ãã
æ¥å¹´ä»¥éåå ãããæ¹ã«å°ãã§ãåèã«ãªãã°å¹¸ãã§ãã
éå¬ä¸æ¢
ä»å¹´ã® PG BATTLE ã¯ã2024å¹´10æ19æ¥ ã«éå¬äºå®ã§ãããã主å¬è ã®å¤æã§éå¬ãä¸æ¢ã¨ãªãã¾ãããæã ãã¨ã³ããªã¼ãã¦ããããæ¥ãçµããªããã¡ã§ã®çºè¡¨ã§ãããã楽ãã¿ã«ãã¦ããã®ã§é常ã«æ®å¿µã§ããã
ã¾ãæ¥å¹´éå¬ãããããã§ããã°ããã²åå ãããã¨æã£ã¦ãã¾ãã