这不是逼我吗,写了个BFS居然超时了。
1 #include2 #include 3 int main() 4 { 5 int i; 6 while(scanf("%d",&i)!=EOF) 7 { 8 if(i == 0) break; 9 if(i == 1)printf("1\n"); 10 else if(i == 2)printf("10\n"); 11 else if(i == 3)printf("111\n"); 12 else if(i == 4)printf("100\n"); 13 else if(i == 5)printf("10\n"); 14 else if(i == 6)printf("1110\n"); 15 else if(i == 7)printf("1001\n"); 16 else if(i == 8)printf("1000\n"); 17 else if(i == 9)printf("111111111\n"); 18 else if(i == 10)printf("10\n"); 19 else if(i == 11)printf("11\n"); 20 else if(i == 12)printf("11100\n"); 21 else if(i == 13)printf("1001\n"); 22 else if(i == 14)printf("10010\n"); 23 else if(i == 15)printf("1110\n"); 24 else if(i == 16)printf("10000\n"); 25 else if(i == 17)printf("11101\n"); 26 else if(i == 18)printf("1111111110\n"); 27 else if(i == 19)printf("11001\n"); 28 else if(i == 20)printf("100\n"); 29 else if(i == 21)printf("10101\n"); 30 else if(i == 22)printf("110\n"); 31 else if(i == 23)printf("110101\n"); 32 else if(i == 24)printf("111000\n"); 33 else if(i == 25)printf("100\n"); 34 else if(i == 26)printf("10010\n"); 35 else if(i == 27)printf("1101111111\n"); 36 else if(i == 28)printf("100100\n"); 37 else if(i == 29)printf("1101101\n"); 38 else if(i == 30)printf("1110\n"); 39 else if(i == 31)printf("111011\n"); 40 else if(i == 32)printf("100000\n"); 41 else if(i == 33)printf("111111\n"); 42 else if(i == 34)printf("111010\n"); 43 else if(i == 35)printf("10010\n"); 44 else if(i == 36)printf("11111111100\n"); 45 else if(i == 37)printf("111\n"); 46 else if(i == 38)printf("110010\n"); 47 else if(i == 39)printf("10101\n"); 48 else if(i == 40)printf("1000\n"); 49 else if(i == 41)printf("11111\n"); 50 else if(i == 42)printf("101010\n"); 51 else if(i == 43)printf("1101101\n"); 52 else if(i == 44)printf("1100\n"); 53 else if(i == 45)printf("1111111110\n"); 54 else if(i == 46)printf("1101010\n"); 55 else if(i == 47)printf("10011\n"); 56 else if(i == 48)printf("1110000\n"); 57 else if(i == 49)printf("1100001\n"); 58 else if(i == 50)printf("100\n"); 59 else if(i == 51)printf("100011\n"); 60 else if(i == 52)printf("100100\n"); 61 else if(i == 53)printf("100011\n"); 62 else if(i == 54)printf("11011111110\n"); 63 else if(i == 55)printf("110\n"); 64 else if(i == 56)printf("1001000\n"); 65 else if(i == 57)printf("11001\n"); 66 else if(i == 58)printf("11011010\n"); 67 else if(i == 59)printf("11011111\n"); 68 else if(i == 60)printf("11100\n"); 69 else if(i == 61)printf("100101\n"); 70 else if(i == 62)printf("1110110\n"); 71 else if(i == 63)printf("1111011111\n"); 72 else if(i == 64)printf("1000000\n"); 73 else if(i == 65)printf("10010\n"); 74 else if(i == 66)printf("1111110\n"); 75 else if(i == 67)printf("1101011\n"); 76 else if(i == 68)printf("1110100\n"); 77 else if(i == 69)printf("10000101\n"); 78 else if(i == 70)printf("10010\n"); 79 else if(i == 71)printf("10011\n"); 80 else if(i == 72)printf("111111111000\n"); 81 else if(i == 73)printf("10001\n"); 82 else if(i == 74)printf("1110\n"); 83 else if(i == 75)printf("11100\n"); 84 else if(i == 76)printf("1100100\n"); 85 else if(i == 77)printf("1001\n"); 86 else if(i == 78)printf("101010\n"); 87 else if(i == 79)printf("10010011\n"); 88 else if(i == 80)printf("10000\n"); 89 else if(i == 81)printf("1111111101\n"); 90 else if(i == 82)printf("111110\n"); 91 else if(i == 83)printf("101011\n"); 92 else if(i == 84)printf("1010100\n"); 93 else if(i == 85)printf("111010\n"); 94 else if(i == 86)printf("11011010\n"); 95 else if(i == 87)printf("11010111\n"); 96 else if(i == 88)printf("11000\n"); 97 else if(i == 89)printf("11010101\n"); 98 else if(i == 90)printf("1111111110\n"); 99 else if(i == 91)printf("1001\n");100 else if(i == 92)printf("11010100\n");101 else if(i == 93)printf("10000011\n");102 else if(i == 94)printf("100110\n");103 else if(i == 95)printf("110010\n");104 else if(i == 96)printf("11100000\n");105 else if(i == 97)printf("11100001\n");106 else if(i == 98)printf("11000010\n");107 else if(i == 99)printf("111111111111111111\n");108 else if(i == 100)printf("100\n");109 else if(i == 101)printf("101\n");110 else if(i == 102)printf("1000110\n");111 else if(i == 103)printf("11100001\n");112 else if(i == 104)printf("1001000\n");113 else if(i == 105)printf("101010\n");114 else if(i == 106)printf("1000110\n");115 else if(i == 107)printf("100010011\n");116 else if(i == 108)printf("110111111100\n");117 else if(i == 109)printf("1001010111\n");118 else if(i == 110)printf("110\n");119 else if(i == 111)printf("111\n");120 else if(i == 112)printf("10010000\n");121 else if(i == 113)printf("1011011\n");122 else if(i == 114)printf("110010\n");123 else if(i == 115)printf("1101010\n");124 else if(i == 116)printf("110110100\n");125 else if(i == 117)printf("10101111111\n");126 else if(i == 118)printf("110111110\n");127 else if(i == 119)printf("100111011\n");128 else if(i == 120)printf("111000\n");129 else if(i == 121)printf("11011\n");130 else if(i == 122)printf("1001010\n");131 else if(i == 123)printf("10001100111\n");132 else if(i == 124)printf("11101100\n");133 else if(i == 125)printf("1000\n");134 else if(i == 126)printf("11110111110\n");135 else if(i == 127)printf("11010011\n");136 else if(i == 128)printf("10000000\n");137 else if(i == 129)printf("100100001\n");138 else if(i == 130)printf("10010\n");139 else if(i == 131)printf("101001\n");140 else if(i == 132)printf("11111100\n");141 else if(i == 133)printf("11101111\n");142 else if(i == 134)printf("11010110\n");143 else if(i == 135)printf("11011111110\n");144 else if(i == 136)printf("11101000\n");145 else if(i == 137)printf("10001\n");146 else if(i == 138)printf("100001010\n");147 else if(i == 139)printf("110110101\n");148 else if(i == 140)printf("100100\n");149 else if(i == 141)printf("10011\n");150 else if(i == 142)printf("100110\n");151 else if(i == 143)printf("1001\n");152 else if(i == 144)printf("1111111110000\n");153 else if(i == 145)printf("11011010\n");154 else if(i == 146)printf("100010\n");155 else if(i == 147)printf("1100001\n");156 else if(i == 148)printf("11100\n");157 else if(i == 149)printf("110111\n");158 else if(i == 150)printf("11100\n");159 else if(i == 151)printf("1110001\n");160 else if(i == 152)printf("11001000\n");161 else if(i == 153)printf("10111110111\n");162 else if(i == 154)printf("10010\n");163 else if(i == 155)printf("1110110\n");164 else if(i == 156)printf("1010100\n");165 else if(i == 157)printf("10101101011\n");166 else if(i == 158)printf("100100110\n");167 else if(i == 159)printf("100011\n");168 else if(i == 160)printf("100000\n");169 else if(i == 161)printf("11101111\n");170 else if(i == 162)printf("11111111010\n");171 else if(i == 163)printf("1010111\n");172 else if(i == 164)printf("1111100\n");173 else if(i == 165)printf("1111110\n");174 else if(i == 166)printf("1010110\n");175 else if(i == 167)printf("11111011\n");176 else if(i == 168)printf("10101000\n");177 else if(i == 169)printf("10111101\n");178 else if(i == 170)printf("111010\n");179 else if(i == 171)printf("1111011111\n");180 else if(i == 172)printf("110110100\n");181 else if(i == 173)printf("1011001101\n");182 else if(i == 174)printf("110101110\n");183 else if(i == 175)printf("100100\n");184 else if(i == 176)printf("110000\n");185 else if(i == 177)printf("100101111\n");186 else if(i == 178)printf("110101010\n");187 else if(i == 179)printf("11010111\n");188 else if(i == 180)printf("11111111100\n");189 else if(i == 181)printf("1001111\n");190 else if(i == 182)printf("10010\n");191 else if(i == 183)printf("100101\n");192 else if(i == 184)printf("110101000\n");193 else if(i == 185)printf("1110\n");194 else if(i == 186)printf("100000110\n");195 else if(i == 187)printf("1001011\n");196 else if(i == 188)printf("1001100\n");197 else if(i == 189)printf("1010111010111\n");198 else if(i == 190)printf("110010\n");199 else if(i == 191)printf("11101111\n");200 else if(i == 192)printf("111000000\n");201 else if(i == 193)printf("11001\n");202 else if(i == 194)printf("111000010\n");203 else if(i == 195)printf("101010\n");204 else if(i == 196)printf("110000100\n");205 else if(i == 197)printf("1101000101\n");206 else if(i == 198)printf("1111111111111111110\n");207 else if(i == 199)printf("111000011\n");208 else if(i == 200)printf("1000\n");209 210 }211 return 0;212 }