結果
| 問題 |
No.522 Make Test Cases(テストケースを作る)
|
| ユーザー |
sekiya9311
|
| 提出日時 | 2017-06-03 11:50:22 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 471 ms / 2,000 ms |
| コード長 | 1,785 bytes |
| コンパイル時間 | 856 ms |
| コンパイル使用メモリ | 112,172 KB |
| 実行使用メモリ | 66,612 KB |
| 最終ジャッジ日時 | 2024-09-22 04:26:01 |
| 合計ジャッジ時間 | 3,459 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
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 Competitive_Programming
{
class MainClass
{
Scanner sc;
static void Main(string[] args)
{
new MainClass().solve();
}
void solve()
{
sc = new Scanner();
int N = sc.NextInt();
StringBuilder ans = new StringBuilder();
for (int a = 1; a <= N; a++)
{
for (int b = a; b <= N; b++)
{
int c = N - a - b;
if (b <= c)
{
ans.AppendLine(a + " " + b + " " + c);
}
}
}
Console.Write(ans);
}
}
class Scanner
{
Queue<string> buf;
public Scanner()
{
buf = new Queue<string>();
this.GetBuf();
}
private void GetBuf()
{
if (buf.Count == 0)
{
string[] stringArray = Console.ReadLine().Split(' ');
foreach (string e in stringArray)
{
buf.Enqueue(e);
}
}
}
public int NextInt()
{
this.GetBuf();
return int.Parse(buf.Dequeue());
}
public long NextLong()
{
this.GetBuf();
return long.Parse(buf.Dequeue());
}
public double NextDouble()
{
this.GetBuf();
return double.Parse(buf.Dequeue());
}
public string Next()
{
this.GetBuf();
return buf.Dequeue();
}
}
}
sekiya9311