QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#96262#2921. Land Equalitymariam#WA 2ms3388kbC++172.5kb2023-04-13 18:12:272023-04-13 18:12:30

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-13 18:12:30]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3388kb
  • [2023-04-13 18:12:27]
  • 提交

answer

//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <set>
#include <unordered_set>
#include <queue>
#include <map>
#include <cmath>
#include <climits>
#include <iomanip>
#include <unordered_map>
#include <stdio.h>
#include <stack>
#include <list>
#include "complex"
#include <assert.h>

#define el '\n'
#define ll long long
#define ld long double
using namespace std;
//
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//
//using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

const int N = 2e5 + 5, mod = 1e9 + 7, MAX = 1e9 + 1, M = 1e5;
long double PI = 3.14159265358979323846;;
#define point  complex<long double>
#define vec(a, b) b-a
#define dot(a, b) (long double)(conj(a)*b).real()
#define cross(a, b) (long double)(conj(a)*b).imag()
#define length(a) (hypot((a).imag(), (a).real()))
#define angle(a) atan2((a).imag(), (a).real())
int h, w;
//char a[201][201];
//int dx[] = {0, 0, -1, 1, 1, -1, -1, 1}, dy[] = {-1, 1, 0, 0, 1, -1, 1, -1};
//int dx[] = {-1, -1, 0, 0, 1, 1}, dy[] = {-1, 0, -1, 1, 0, 1};
//
//bool valid(int i, int j) {
//    return (i < h && i >= 0 && j < w && j >= 0);
//}
//
//bool vis[201][201];

ll mul(ll a, ll b) {
    return ((a % mod) * (b % mod)) % mod;
}

ll add(ll a, ll b) {
    return ((a % mod) + (b % mod)) % mod;
}

ll sub(ll a, ll b) {
    return ((((a + mod) % mod) - ((b + mod) % mod)) + mod) % mod;
}

ll fastpow(ll b, ll p) {
    if (p == 0)
        return 1;
    if (p == 1) {
        return b;
    }
    ll hp = fastpow(b, p / 2);
    ll ans = ((hp % mod) * (hp % mod)) % mod;

    if (p % 2) {
        ans = (ans * b) % mod;
    }

    return ans % mod;
}


void m() {
    int n, m;
    cin >> n >> m;
    int zeroCnt = 0, mn = 3, twoCnt = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            int x;
            cin >> x;
            twoCnt += (x == 2);
            zeroCnt += (x == 0);
            if (x)
                mn = min(mn, x);
        }
    }
    if (zeroCnt == 2 || twoCnt % 2 == 0)
        cout << 0;
    else if (zeroCnt == 1)
        cout << mn;
    else
        cout << (long long) (1LL << twoCnt / 2) ;

}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    //   cin>>t;
    while (t--) {
        m();
    }

}

详细

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3388kb

input:

1 2
0 1

output:

0

result:

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