QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#96470#2921. Land Equalitymariam#Compile Error//C++172.1kb2023-04-13 21:50:012023-04-13 21:50:05

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 21:50:05]
  • 评测
  • [2023-04-13 21:50:01]
  • 提交

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];



void m() {
    int r, c, x;
    cin >> r >> c;
    int c0 = 0, c2 = 0, c1 = 0;
    for (int i = 0; i < r; ++i) {
        for (int j = 0; j < c; ++j) {
            cin >> x;
            if (x == 0)c0++;
            else if (x == 2)c2++;
            else c1++;

        }
    }
    ll ans = 0;
    if (c0 >= 2)
        ans = 0;
    else if (c0 == 1) {
        if (c1)ans = 1;
        else if (c2)ans = 2;
    } else if (c2 >= 1) {
        if (c2 % 2 == 0)
            ans = 0;
        else
            ans = (1ll * (1ll << (c2 / 2+1))-(1ll * (1ll << (c2 / 2)));
    } else
        ans = 0;
    cout<<ans;
}

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

}

Details

answer.code: In function ‘void m()’:
answer.code:77:71: error: expected ‘)’ before ‘;’ token
   77 |             ans = (1ll * (1ll << (c2 / 2+1))-(1ll * (1ll << (c2 / 2)));
      |                   ~                                                   ^
      |                                                                       )