Submission #73203

#TimeUsernameProblemLanguageResultExecution timeMemory
73203testJudge Against Wrong Code (FXCUP3_judge)C++14
49 / 100
1573 ms172124 KiB
#include<bits/stdc++.h> using namespace std; const int MN = 500010; int X, D, C; int data[MN], code[MN], cnt1[1 << 20], cnt2[1 << 20]; int cc1[1 << 20][20]; int dp1(int mask, int p) { if(p == X) return cnt1[mask]? mask : 0; int &ret = cc1[mask][p]; if(ret != -1) return ret; ret = 0; if(mask & (1 << p)) { ret |= dp1(mask, p + 1); ret |= dp1(mask ^ (1 << p), p + 1); } else ret |= dp1(mask, p + 1); return ret; } int cc2[1 << 20][20]; int dp2(int mask, int p) { if(p == X) return cnt2[mask]; int &ret = cc2[mask][p]; if(ret != -1) return ret; ret = 0; if(mask & (1 << p)) { ret += dp2(mask, p + 1); ret += dp2(mask ^ (1 << p), p + 1); } else ret += dp2(mask, p + 1); return ret; } int ans[MN]; int main() { scanf("%d", &X); scanf("%d", &D); for(int i = 0; i < D; i++) { scanf("\n"); for(int j = 0; j < X; j++) { char t; scanf("%c", &t); if(t == 'o') data[i] ^= (1 << j); } cnt1[ data[i] ]++; } scanf("%d", &C); for(int i = 0; i < C; i++) { scanf("\n"); for(int j = 0; j < X; j++) { char t; scanf("%c", &t); if(t == 'x') code[i] ^= (1 << j); } cnt2[ code[i] ]++; } memset(cc1, -1, sizeof(cc1)); memset(cc2, -1, sizeof(cc2)); for(int i = 0; i < (1 << X); i++) { if(dp1(i, 0) == i) { ans[ C - dp2((1 << X) - 1 - i, 0) ] = 1; } } for(int i = 1; i <= C; i++) { if(ans[i]) printf("o"); else printf("x"); } }

Compilation message (stderr)

judge.cpp: In function 'int main()':
judge.cpp:42:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &X);
     ~~~~~^~~~~~~~~~
judge.cpp:43:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &D);
     ~~~~~^~~~~~~~~~
judge.cpp:46:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("\n");
         ~~~~~^~~~~~
judge.cpp:48:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             char t; scanf("%c", &t);
                     ~~~~~^~~~~~~~~~
judge.cpp:55:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &C);
     ~~~~~^~~~~~~~~~
judge.cpp:58:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("\n");
         ~~~~~^~~~~~
judge.cpp:60:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             char t; scanf("%c", &t);
                     ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...