結果
| 問題 | No.175 simpleDNA |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-10 19:15:26 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 345 bytes |
| 記録 | |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 21,708 KB |
| 最終ジャッジ日時 | 2026-02-23 18:33:12 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:9: error: C++ style comments are not allowed in ISO C90
4 | // your code goes here
| ^
main.c:4:9: note: (this will be reported only once per input file)
main.c:6:25: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long unsigned int *’ [-Wformat=]
6 | fscanf(stdin, "%d", &l);
| ~^ ~~
| | |
| | long unsigned int *
| int *
| %ld
main.c:7:25: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long unsigned int *’ [-Wformat=]
7 | fscanf(stdin, "%d", &n);
| ~^ ~~
| | |
| | long unsigned int *
| int *
| %ld
main.c:6:9: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | fscanf(stdin, "%d", &l);
| ^~~~~~~~~~~~~~~~~~~~~~~
main.c:7:9: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | fscanf(stdin, "%d", &n);
| ^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void) {
// your code goes here
unsigned long ans, l, n, i;
fscanf(stdin, "%d", &l);
fscanf(stdin, "%d", &n);
l -= 3;
ans = 1;
for(i = 0; i < l; i++)
ans = ans * 2;
ans *= n;
printf("%ld\n", ans);
return 0;
}