結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー recososorecososo
提出日時 2020-02-26 14:39:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,036 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 1,630 ms
コンパイル使用メモリ 167,428 KB
実行使用メモリ 28,416 KB
最終ジャッジ日時 2024-04-21 16:23:52
合計ジャッジ時間 6,332 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
5,248 KB
testcase_01 AC 37 ms
5,376 KB
testcase_02 AC 30 ms
5,376 KB
testcase_03 AC 77 ms
5,376 KB
testcase_04 AC 3 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 5 ms
5,376 KB
testcase_09 AC 58 ms
5,376 KB
testcase_10 AC 1,036 ms
28,416 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