結果
| 問題 |
No.481 1から10
|
| コンテスト | |
| ユーザー |
_mi_lin_
|
| 提出日時 | 2019-04-10 16:59:38 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 1,031 bytes |
| コンパイル時間 | 3,718 ms |
| コンパイル使用メモリ | 106,024 KB |
| 実行使用メモリ | 25,864 KB |
| 最終ジャッジ日時 | 2024-07-07 17:21:33 |
| 合計ジャッジ時間 | 3,548 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 |
コンパイルメッセージ
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;
namespace No481OnetoTen
{
class Program
{
static void Main(string[] args)
{
//値の入力
string[] number1 = Console.ReadLine().Split(' ');
int[] number2 = new int[number1.Length];
int ans = 0; //抜けてる数字をカウントするためのもの
for (int i = 0; i < number1.Length; i++)
{
number2[i] = int.Parse(number1[i]);
ans += 1;
//10が漏れてる場合
if (number2[8] == 9)
{
Console.WriteLine(ans+1);
break;
}
//1~9のいずれかが漏れてる場合
else if (number2[i] != i + 1)
{
Console.WriteLine(ans);
break;
}
}
}
}
}
_mi_lin_