Submission #72181

#TimeUsernameProblemLanguageResultExecution timeMemory
72181BBBSNG (#118)Judge Against Wrong Code (FXCUP3_judge)C++17
0 / 100
2 ms248 KiB
#include <bits/stdc++.h> using namespace std; int K[1101010], F[1111][1111]; bool ans[505050], cnt[1101010]; int k, b, n, m; int main() { int i, j, l, s, s1, s2; char str[33]; scanf("%d", &k); b = k / 2; scanf("%d", &n); for(i=1; i<=n; i++){ scanf("%s", str); for(s=0, j=0; j<k; j++){ if(str[j] != '.') s |= (1 << j); } K[s] |= s; } scanf("%d", &m); for(i=1; i<=m; i++){ scanf("%s", str); for(s1=0, j=0; j<b; j++){ if(str[j] == '.') s1 |= (1 << j); } for(s2=0, j=b; j<k; j++){ if(str[j] == '.') s2 |= (1 << j-b); } F[s1][s2] ++; } for(i=0; i<(1<<k); i++){ for(j=0; j<k; j++){ if(i & (1 << j)) cnt[i] ^= 1; } } for(i=0; i<(1<<b); i++){ for(j=0; j<(1<<(k-b)); j++){ for(l=j; l; l=(l-1)&j){ if(cnt[l]) F[i][j] += F[i][j - l]; else F[i][j] -= F[i][j - l]; } } } for(i=0; i<(1<<k-b); i++){ for(j=0; j<(1<<b); j++){ for(l=j; l; l=(l-1)&j){ if(cnt[l]) F[j][i] += F[j - l][i]; else F[j][i] -= F[j - l][i]; } } } for(i=0; i<(1<<k); i++){ for(j=0; j<k; j++){ if(i & (1 << j)) K[i] |= K[i - (1 << j)]; } if(K[i] == i){ ans[m - F[i >> b][i & ((1 << b) - 1)]] = 1; } // printf("%d %d\n", i, F[i >> b][i & ((1 << b) - 1)]); } for(i=1; i<=m; i++){ printf("%c", ans[i]? 'O' : 'X'); } printf("\n"); return 0; }

Compilation message (stderr)

judge.cpp: In function 'int main()':
judge.cpp:40:35: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
    if(str[j] == '.') s2 |= (1 << j-b);
                                  ~^~
judge.cpp:61:18: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
  for(i=0; i<(1<<k-b); i++){
                 ~^~
judge.cpp:14:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &k);
  ~~~~~^~~~~~~~~~
judge.cpp:18:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
judge.cpp:21:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", str);
   ~~~~~^~~~~~~~~~~
judge.cpp:30:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &m);
  ~~~~~^~~~~~~~~~
judge.cpp:33:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", str);
   ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...