結果

問題 No.175 simpleDNA
ユーザー suppy193
提出日時 2015-05-28 09:41:16
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 317 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 12:05:50
合計ジャッジ時間 515 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d", &L);
      |         ^~~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d", &N);
      |         ^~~~~~~~~~~~~~~
main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |                 scanf("%s", S);
      |                 ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	int i, L, N, length;
	int ans;
	char S[31];
	scanf("%d", &L);
	scanf("%d", &N);
	for(i = 1;i <= N;i++){
		scanf("%s", S);
	}
	length = 0;
	while(S[length] != '\0'){
		length++;
	}
	ans = 1;
	for(i = 1;i <= L - length;i++){
		ans *= 2;
	}
	printf("%d\n", ans * N);
	
	return 0;
}
0