結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー ei1333333ei1333333
提出日時 2017-06-02 22:26:08
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,019 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 1,250 ms
コンパイル使用メモリ 171,744 KB
実行使用メモリ 15,720 KB
最終ジャッジ日時 2023-10-22 00:13:45
合計ジャッジ時間 4,622 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
4,348 KB
testcase_01 AC 35 ms
4,348 KB
testcase_02 AC 27 ms
4,348 KB
testcase_03 AC 70 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 3 ms
4,348 KB
testcase_09 AC 49 ms
4,348 KB
testcase_10 AC 1,019 ms
15,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

typedef long long int64;

int main()
{
  int N;
  cin >> N;
  vector< tuple< int, int, int > > st;
  for(int a = 1; a <= N; a++) {
    for(int b = 1; b <= N; b++) {
      int c = N - a - b;
      if(c > 0 && a <= b && b <= c) st.emplace_back(a, b, c);
    }
  }
  sort(begin(st), end(st));
  for(int i = 0; i < st.size(); i++) {
    int a, b, c;
    tie(a, b, c) = st[i];
    cout << a << " " << b << " " << c << endl;
  }
}
0