結果

問題 No.523 LED
コンテスト
ユーザー RIGIH
提出日時 2017-06-23 19:08:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 58,076 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 00:51:09
合計ジャッジ時間 1,428 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
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