Submission #20224

#TimeUsernameProblemLanguageResultExecution timeMemory
20224byrage분배 (kriii3_Q)C11
0 / 24
1 ms0 KiB
#include <stdio.h> int main(){ int n,k,i,j,t = 0; scanf("%d%d",&n, &k); for (i = 0; i < (1 << k); i++) { for (j = 0; j < (1 << n - 1); j++) { if (j == (1 << n - 1) / 2 ) { t = (1 << n - i - 1); } printf("%d ", j + t); } t = t >> 1; printf("\n"); } }

Compilation message (stderr)

Q.c: In function 'main':
Q.c:8:26: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
  for (j = 0; j < (1 << n - 1); j++) {
                          ^
Q.c:9:20: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   if (j == (1 << n - 1) / 2 ) {
                    ^
Q.c:10:20: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
    t = (1 << n - i - 1);
                    ^
Q.c:5:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d",&n, &k);
   ^
#Verdict Execution timeMemoryGrader output
Fetching results...