[Offer收割]编程练习赛40 register

Ended

Participants:189

Verdict:Time Limit Exceeded
Score:30 / 100
Submitted:2017-12-17 13:47:45

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
typedef long long ll;
#define FOR(begin,end) for(int i = begin; i < end; ++i)
using namespace std;
char mp[1100][1100];
char tmp[1100][1100];
inline int GetBit(char n ){
    return n-'0';
}
inline bool judge(char a[1100][1100], int rb,int re,int cb,int ce){
    for(int i = rb; i < re; ++i)
        for(int j = cb; j < ce; ++j){
            if(j > cb && GetBit(a[i][j]) == GetBit(a[i][j-1]))
                return false;
            if(i > rb && GetBit(a[i-1][j]) == GetBit(a[i][j]))
                return false;
        }
    return true;
}
int main(){
    int N,M;
    //freopen("/Users/user/Desktop/1.txt","r",stdin);
    cin >> N >> M;
    for(int i = 0; i < N; ++i)
        for(int j = 0; j < M; ++j)
            cin >> mp[i][j];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX