結果

問題 No.411 昇順昇順ソート
ユーザー akakimidori
提出日時 2016-12-09 01:58:06
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 1,087 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-28 16:06:20
合計ジャッジ時間 2,071 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘run’:
main.c:5:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |   scanf("%d%d",&N,&K);
      |   ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

void run(void){
  int N,K;
  scanf("%d%d",&N,&K);
  if(N==K){
    printf("1\n");
    return;
  }
  if(K==1){
    if(N==2){
      printf("0\n");
    } else {
      printf("%d\n",(1<<(N-1))-N+1);
    }
  } else {
    printf("%d\n",(1<<(N-K)));
  }
  return;
}

int main(void){
  run();
  return 0;
}
0