QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#398288#3763. Absolute Difference EquationSamponYW#WA 50ms4568kbC++141.3kb2024-04-25 10:25:032024-04-25 10:25:03

Judging History

你现在查看的是最新测评结果

  • [2024-04-25 10:25:03]
  • 评测
  • 测评结果:WA
  • 用时:50ms
  • 内存:4568kb
  • [2024-04-25 10:25:03]
  • 提交

answer

#include <bits/stdc++.h>
#define db double
#define il inline
#define re register
#define ll long long
#define ui unsigned
#define ull ui ll
#define i128 __int128
#define pii pair<int, int>
#define fi first
#define se second
#define eb emplace_back
#define SZ(v) (int)v.size()
#define ALL(v) v.begin(), v.end()
#define mems(v, x) memset(v, x, sizeof(v))
#define memc(a, b) memcpy(a, b, sizeof(a))
#define FOR(i, L, R) for(re int i = (L); i <= (R); ++i)
#define ROF(i, R, L) for(re int i = (R); i >= (L); --i)
#define LS i << 1, l, mid
#define RS i << 1 | 1, mid + 1, r
#define popc(x) __builtin_popcount(x)
using namespace std;
#define N 2505
#define P 1000000007
il int add(int x, int y) {return x + y < P ? x + y : x + y - P;}
il void addr(int &x, int y) {(x += y) >= P && (x -= P);}
il int qpow(int p, int n = P - 2) {
  int s = 1;
  while(n) {
    if(n & 1) s = 1ll * s * p % P;
    p = 1ll * p * p % P, n >>= 1;
  }
  return s;
}
const int mu = qpow(1e4);
string str;
il void WORK() {
  int s = 0, cnt = 0;
  for(auto c : str) {
    if(c == '?') ++cnt;
    else s += c & 1;
  }
  if(!cnt) {
    cout << (s & 1) << "\n"; return ;
  }
  cout << qpow(2, cnt - 1) << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  while(cin >> str) WORK();
  cerr << 1.0 * clock() / CLOCKS_PER_SEC;
  return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 50ms
memory: 4568kb

input:

1
?????
1010?1?0
0
1
?
00
10
?0
01
11
?1
0?
1?
??
000
100
?00
010
110
?10
0?0
1?0
??0
001
101
?01
011
111
?11
0?1
1?1
??1
00?
10?
?0?
01?
11?
?1?
0??
1??
???
0000
1000
?000
0100
1100
?100
0?00
1?00
??00
0010
1010
?010
0110
1110
?110
0?10
1?10
??10
00?0
10?0
?0?0
01?0
11?0
?1?0
0??0
1??0
???0
0001
10...

output:

1
16
2
0
1
1
0
1
1
1
0
1
1
1
2
0
1
1
1
0
1
1
1
2
1
0
1
0
1
1
1
1
2
1
1
2
1
1
2
2
2
4
0
1
1
1
0
1
1
1
2
1
0
1
0
1
1
1
1
2
1
1
2
1
1
2
2
2
4
1
0
1
0
1
1
1
1
2
0
1
1
1
0
1
1
1
2
1
1
2
1
1
2
2
2
4
1
1
2
1
1
2
2
2
4
1
1
2
1
1
2
2
2
4
2
2
4
2
2
4
4
4
8
0
1
1
1
0
1
1
1
2
1
0
1
0
1
1
1
1
2
1
1
2
1
1
2
2
2
4...

result:

wrong answer 19th lines differ - expected: '0', found: '1'