結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー mbanmban
提出日時 2017-06-03 14:19:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 1,998 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 810 ms
コンパイル使用メモリ 106,892 KB
実行使用メモリ 27,876 KB
最終ジャッジ日時 2023-10-22 02:57:41
合計ジャッジ時間 5,370 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
23,780 KB
testcase_01 AC 88 ms
25,828 KB
testcase_02 AC 72 ms
25,828 KB
testcase_03 AC 157 ms
27,876 KB
testcase_04 AC 23 ms
23,796 KB
testcase_05 AC 24 ms
23,792 KB
testcase_06 AC 24 ms
23,796 KB
testcase_07 AC 24 ms
23,780 KB
testcase_08 AC 28 ms
23,780 KB
testcase_09 AC 115 ms
25,828 KB
testcase_10 AC 1,998 ms
27,876 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        new Magatro().Solve();
    }
}

class Magatro
{
    private int N;
    public void Solve()
    {
        N = int.Parse(Console.ReadLine());
        for (int a = 1; a <= N; a++)
        {
            for (int b = a; a + b <= N; b++)
            {
                int c = N - a - b;
                if (c <= 0 || b > c)
                {
                    continue;
                }
                Console.WriteLine("{0} {1} {2}", a, b, c);
            }
        }
    }
}

0