6682021-11-07 10:45:50TSomaToronyépítés (2,2,3,3)cpp14Wrong answer 4/402ms1260 KiB
#undef _GLIBCXX_DEBUG
#pragma GCC optimize("Ofast,inline")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include <stdio.h>
#include <stdint.h>

using namespace std;

long long N, i, a, b, c, d;
long long const P = 20210108;

int main()
{
	scanf("%d\n", &N);

	switch (N)
	{
	case 1:
		printf("%d\n", 1);
		break;
	case 2:
		printf("%d\n", 2);
		break;
	case 3:
		printf("%d\n", 2);
		break;
	default:
		for (i = 4; i <= N; ++i)
		{
			d = (2 * (a + b)) % P;
			a = b;
			b = c;
			c = d;
		}

		printf("%d\n", d);
		break;
	}
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Wrong answer0/01ms1096 KiB
2Wrong answer0/01ms1260 KiB
3Wrong answer0/21ms1204 KiB
4Accepted2/21ms1208 KiB
5Wrong answer0/31ms1204 KiB
6Wrong answer0/31ms1204 KiB
7Wrong answer0/31ms1080 KiB
8Wrong answer0/31ms1080 KiB
9Wrong answer0/31ms1080 KiB
10Wrong answer0/31ms1204 KiB
11Wrong answer0/32ms1208 KiB
12Wrong answer0/31ms1208 KiB
13Wrong answer0/41ms1204 KiB
14Wrong answer0/41ms1076 KiB
15Accepted2/21ms1208 KiB
16Wrong answer0/21ms1204 KiB