結果
| 問題 | No.523 LED |
| コンテスト | |
| ユーザー |
RIGIH
|
| 提出日時 | 2017-06-23 19:08:32 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 318 bytes |
| 記録 | |
| コンパイル時間 | 567 ms |
| コンパイル使用メモリ | 77,012 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-20 00:00:26 |
| 合計ジャッジ時間 | 1,825 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 10 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:23:23: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
23 | printf("%d\n",ans);
| ~~~~~~^~~~~~~~~~~~
main.cpp:13:22: note: 'ans' was declared here
13 | long ans,a=1;
| ^~~
ソースコード
#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;
}
RIGIH