提出 #1415420


ソースコード 拡げる

#include <stdio.h>
#include <math.h>

#define CONS (1000000000 + 7)

int main()
{
	long long int n;
	long long int m;

	long long int i;

	unsigned long long int nm = 1;

	scanf("%lld %lld", &n, &m);

	if(n+1 == m || m+1 == n){
		for(i = 2; i <= n; i++){
			nm *= i;
			nm %= CONS;
		}
		for(i = 2; i <= m; i++){
			nm *= i;
			nm %= CONS;
		}
	}
	else if(n == m){
		for(i = 1; i <= n; i++){
			nm *= i;
			nm %= CONS;
		}

		nm = (nm * nm * 2) % CONS;
	}
	else {
		nm = 0;
	}

	printf("%lld\n", nm);

	return 0;
}

提出情報

提出日時
問題 C - Reconciled?
ユーザ ponntuu3
言語 C (GCC 5.4.1)
得点 300
コード長 555 Byte
結果 AC
実行時間 2 ms
メモリ 128 KiB

コンパイルエラー

./Main.c: In function ‘main’:
./Main.c:15:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld", &n, &m);
  ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 4
AC × 16
セット名 テストケース
Sample s1.txt, s2.txt, s3.txt, s4.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, s1.txt, s2.txt, s3.txt, s4.txt
ケース名 結果 実行時間 メモリ
01.txt AC 1 ms 128 KiB
02.txt AC 1 ms 128 KiB
03.txt AC 1 ms 128 KiB
04.txt AC 1 ms 128 KiB
05.txt AC 1 ms 128 KiB
06.txt AC 1 ms 128 KiB
07.txt AC 1 ms 128 KiB
08.txt AC 1 ms 128 KiB
09.txt AC 1 ms 128 KiB
10.txt AC 1 ms 128 KiB
11.txt AC 1 ms 128 KiB
12.txt AC 1 ms 128 KiB
s1.txt AC 1 ms 128 KiB
s2.txt AC 1 ms 128 KiB
s3.txt AC 2 ms 128 KiB
s4.txt AC 1 ms 128 KiB