結果

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

ソースコード

diff #
raw source code

#include <iostream>

using namespace std;

int n;

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        for (int j = i; j <= n; ++j) {
            if (n - i - j < j) break;
            printf("%d %d %d\n", i, j, n - i - j);
        }
    }

    return 0;
}
0