結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー hiro1729hiro1729
提出日時 2023-07-26 08:52:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 697 bytes
コンパイル時間 2,180 ms
コンパイル使用メモリ 195,116 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-12 10:59:38
合計ジャッジ時間 4,247 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define gcu getchar_unlocked
#define pcu putc_unlocked
#define all(x) x.begin(),x.end()
#define endln() pcu('\n',stdout)
#define space() pcu(' ',stdout)
using namespace std;
int iin(){int r=0,s=1;int c=gcu();while(isspace(c))c=gcu();if(c=='-'){s=-1;c=gcu();}for(;!isspace(c);c=gcu())r=r*10+(c-'0');ungetc(c,stdin);return s*r;}
void iout(int n){if(n<0){pcu('-',stdout);n=-n;}if(n<10){pcu('0'+n,stdout);return;}int i;char b[21];b[20]=0;for(i=20;n>0;b[--i]='0'+n%10,n/=10);fputs(b+i,stdout);}

int main() {
	int n = iin();
	for (int i = 1; i <= n / 3; i++) {
		for (int j = i; j <= (n - i) / 2; j++) {
			iout(i); space(); iout(j); space(); iout(n - i - j); endln();
		}
	}
}
0