結果

問題 No.1569 Nixoracci's Number
ユーザー pengin_2000
提出日時 2022-11-01 20:07:37
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-16 09:47:58
合計ジャッジ時間 1,883 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
long long int a[202];
int main()
{
	long long int n, k;
	scanf("%lld %lld", &n, &k);
	long long int i;
	long long int ans;
	for (i = 0; i < n; i++)
		scanf("%lld", &a[i]);
	if (k % (n + 1) > 0)
		ans = a[k % (n + 1) - 1];
	else
	{
		ans = 0;
		for (i = 0; i < n; i++)
			ans ^= a[i];
	}
	printf("%lld\n", ans);
	return 0;
}
0