結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー ふっぴーふっぴー
提出日時 2017-06-09 00:04:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,110 ms / 2,000 ms
コード長 819 bytes
コンパイル時間 1,917 ms
コンパイル使用メモリ 166,700 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-23 19:56:22
合計ジャッジ時間 8,094 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
4,348 KB
testcase_01 AC 38 ms
4,348 KB
testcase_02 AC 29 ms
4,348 KB
testcase_03 AC 77 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 4 ms
4,348 KB
testcase_09 AC 53 ms
4,348 KB
testcase_10 AC 1,110 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
const int inf=1000000001;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};

int main(){
  int n;
  cin>>n;
  int a,b,c;
  //ll now=time(NULL);
  for(a=1;a<=n/3;a++){
    for(b=a;b<=(n-a)/2;b++){
      c=n-a-b;
      if(c>=b){
	cout<<a<<" "<<b<<" "<<c<<endl;
      }
    }
  }
  //cout<<time(NULL)-now<<endl;
}
0