結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー beetbeet
提出日時 2019-03-27 10:28:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 531 bytes
コンパイル時間 1,997 ms
コンパイル使用メモリ 193,764 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 09:46:52
合計ジャッジ時間 5,267 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,816 KB
testcase_01 AC 7 ms
6,944 KB
testcase_02 AC 6 ms
6,940 KB
testcase_03 AC 12 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 9 ms
6,940 KB
testcase_10 AC 148 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


struct FastIO{
  FastIO(){
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
}fastio_beet;

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  for(Int a=1;a<=n;a++){
    for(Int b=a;a+b<=n;b++){
      Int c=n-(a+b);
      if(b<=c) cout<<a<<" "<<b<<" "<<c<<"\n";
    }
  }
  cout<<flush;
  return 0;
}
0