結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー recososorecososo
提出日時 2020-02-26 14:39:45
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,139 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 1,829 ms
コンパイル使用メモリ 169,016 KB
実行使用メモリ 28,400 KB
最終ジャッジ日時 2023-08-03 18:14:11
合計ジャッジ時間 7,267 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
4,380 KB
testcase_01 AC 39 ms
4,380 KB
testcase_02 AC 30 ms
4,380 KB
testcase_03 AC 78 ms
4,908 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 53 ms
4,380 KB
testcase_10 AC 1,139 ms
28,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin >> n;
    vector<vector<pair<int,int>>> v(n+1);
    for(int i=1;i<=n;i++){
        for(int j=i;j+i<=n;j++){
            v[i+j].push_back({i,j});
        }
    }
    for(int i=1;i<=n;i++){
        for(auto x:v[n-i]){
            if(i>x.first){
                continue;
            }
            cout << i << " " << x.first << " " << x.second << endl;
        }
    }
}
0