結果

問題 No.175 simpleDNA
ユーザー じゃがりこ
提出日時 2018-08-31 20:19:28
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 258 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 29,568 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-13 22:41:57
合計ジャッジ時間 2,221 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:11:22: warning: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   11 |     len = L - strlen(S);
      |                      ^
      |                      |
      |                      char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int main(void){
    int L,N,i,a=1,len;
    char S;
    
    scanf("%d",&L);
    scanf("%d",&N);
    scanf("%s",&S);
    len = L - strlen(S);
    for(i = 1; i <= len; i++){
        a = a*2;
    }
    printf("%d",a*N);
}
0