結果

問題 No.522 Make Test Cases(テストケースを作る)
コンテスト
ユーザー 梧桐
提出日時 2025-11-15 00:29:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 60,500 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-11-15 00:29:43
合計ジャッジ時間 3,951 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~

ソースコード

diff #
raw source code

#include <iostream>

using namespace std;

int n;

void Solve() {
    for (int i = 1; i <= n / 3; ++i) {
        for (int j = i; j <= n; ++j) {
            if (j <= n - i - j) {
                printf("%d %d %d\n", i, j, n - i - j);
            }
        }
    }
}

int main() {
    // freopen("testcase.in", "r", stdin);
    // freopen("testcase.out", "w", stdout);

    scanf("%d", &n);

    Solve();

    return 0;
}
0