제출 #251591

#제출 시각아이디문제언어결과실행 시간메모리
251591BruteforcemanZvijezda (COCI19_zvijezda)C++11
컴파일 에러
0 ms0 KiB
import math import sys n, k = map(int, input().split()) def value(a) : ans = 0 for i in range(len(a)): if a[i] == 1: ans += 1 << i return str(ans) a = [(i, i) for i in range(n)] sz = 1 result = [] while len(a) > 0: s = [0] * n t = [0] * n b = [] for i in range(1, len(a), 2): for j in range(a[i - 1][0], a[i - 1][1] + 1): s[j] = 1 for j in range(a[i][0], a[i][1] + 1): t[j] = 1 b.append((a[i - 1][0], a[i][1])) exp = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))' if len(a) % 2 == 1: s = [0] * n t = [0] * n for j in range(a[-1][0], a[-1][1] + 1): s[j] = 1 for j in range(a[-1][1] + 1, n): t[j] = 1 extra = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))' exp = '(' + exp + '|' + extra + ')' result.append('A=' + exp) a = b[:] sz *= 2 print(len(result)) print('\n'.join(result))

컴파일 시 표준 에러 (stderr) 메시지

zvijezda.cpp:23:11: warning: multi-character character constant [-Wmultichar]
     exp = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
           ^~~~~~
zvijezda.cpp:23:31: warning: character constant too long for its type
     exp = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
                               ^~~~~~~~
zvijezda.cpp:23:53: warning: multi-character character constant [-Wmultichar]
     exp = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
                                                     ^~~~~
zvijezda.cpp:23:71: warning: multi-character character constant [-Wmultichar]
     exp = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
                                                                       ^~~~
zvijezda.cpp:31:17: warning: multi-character character constant [-Wmultichar]
         extra = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
                 ^~~~~~
zvijezda.cpp:31:37: warning: character constant too long for its type
         extra = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
                                     ^~~~~~~~
zvijezda.cpp:31:59: warning: multi-character character constant [-Wmultichar]
         extra = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
                                                           ^~~~~
zvijezda.cpp:31:77: warning: multi-character character constant [-Wmultichar]
         extra = '((A&' + value(s) + ')+((A&' + value(t) + ')>>' + str(sz) + '))'
                                                                             ^~~~
zvijezda.cpp:33:19: warning: multi-character character constant [-Wmultichar]
     result.append('A=' + exp)
                   ^~~~
zvijezda.cpp:1:1: error: 'import' does not name a type; did you mean 'short'?
 import math
 ^~~~~~
 short