結果

問題 No.1820 NandShift
ユーザー 👑 ygussanyygussany
提出日時 2022-01-21 22:33:22
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 873 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 28,920 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-17 06:50:14
合計ジャッジ時間 1,641 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 0 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
4,380 KB
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main()
{
	int i, N, M;
	char X[101], A[101][101];
	scanf("%d %d", &N, &M);
	scanf("%s", X);
	for (i = 1; i <= N; i++) scanf("%s", A[i]);
	
	int k = 5, ans[1001][4];
	ans[0][0] = 2;
	ans[0][1] = 1;
	ans[0][2] = 0;
	ans[0][3] = 0;
	ans[1][0] = 1;
	ans[1][1] = 2;
	ans[1][2] = 1;
	ans[2][0] = 1;
	ans[2][1] = 1;
	ans[2][2] = 1;
	ans[3][0] = 2;
	ans[3][1] = 1;
	ans[3][2] = 1;
	ans[3][3] = 1;
	ans[4][0] = 2;
	ans[4][1] = 0;
	ans[4][2] = 0;
	ans[4][3] = 0;
	for (i = 0; i < M; i++) {
		if (X[M-i-1] == '0') {
			ans[k][0] = 2;
			ans[k][1] = 0;
			ans[k][2] = 0;
			ans[k++][3] = 1;
		}
		ans[k][0] = 1;
		ans[k][1] = 1;
		ans[k++][2] = 1;
	}
	
	printf("%d\n", k);
	for (i = 0; i < k; i++) {
		if (ans[i][0] == 1) printf("1 %d %d\n", ans[i][1], ans[i][2]);
		else printf("2 %d %d %d\n", ans[i][1], ans[i][2], ans[i][3]);
	}
	fflush(stdout);
	return 0;
}
0