結果

問題 No.523 LED
ユーザー RIGIHRIGIH
提出日時 2017-06-23 19:08:32
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 58,816 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-14 21:29:34
合計ジャッジ時間 1,884 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 WA -
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 WA -
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 WA -
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
   23 |                 printf("%d\n",ans);
      |                         ~^    ~~~
      |                          |    |
      |                          int  long int
      |                         %ld

ソースコード

diff #

#include<stdio.h>
#include <iostream>
#include <cstring>
#include <math.h>
using namespace std;


int main(){

		int n;
		cin>>n;
		int i=1;
		long ans,a=1;
		if(n==1){
			printf("1\n");
			return 0;
		}
		for(i=2;i<=n;i++){
			ans=(a*i*(2*i-1))%1000000007;
			a=ans;
		}

		printf("%d\n",ans);

	
	

	

	
	return 0;
}
0