結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー teketeke5000teketeke5000
提出日時 2017-08-20 00:38:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,067 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 1,628 ms
コンパイル使用メモリ 157,916 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 16:46:26
合計ジャッジ時間 5,827 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
5,248 KB
testcase_01 AC 35 ms
5,376 KB
testcase_02 AC 27 ms
5,376 KB
testcase_03 AC 75 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 50 ms
5,376 KB
testcase_10 AC 1,067 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:13: warning: ‘c’ is used uninitialized [-Wuninitialized]
   10 |     while(a <= c) {
      |           ~~^~~~

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

int main(void) {
    int a,b,c,N;
    cin >> N;
    a = 0;
    while(a <= c) {
        a++;
        b = a;
        c = N - a - b;
        while(b <= c) {
            cout << a << " " << b << " " << c << endl;
            b++; c--;
        }
    }
    return 0;
}
0