Submission #777417

# Submission time Handle Problem Language Result Execution time Memory
777417 2023-07-09T08:13:40 Z vjudge1 Sajam (COCI18_sajam) C++17
90 / 90
22 ms 1316 KB
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define OYY 1000000000005
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mid (start+end)/2
#define mod 1000000007
bool dizi[1005][1005];

int main(){
    faster
    int n,k;
    cin>>n>>k;
    char c;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>c;
            if(c=='x')dizi[i][j]=1;
            else dizi[i][j]=0;
        }
    }
    int y=10;
    while(y--){
        for(int i=0;i<n;i++){
            int top=0;
            for(int j=0;j<n;j++){
                top+=dizi[i][j];
            }
            if(top*2>n){
                for(int j=0;j<n;j++){
                    dizi[i][j]^=1;
                }
            }
        }
        int cev=0;
        for(int j=0;j<n;j++){
            int top=0;
            for(int i=0;i<n;i++){
                top+=dizi[i][j];
            }
            if(top*2>n){
                for(int i=0;i<n;i++){
                    dizi[i][j]^=1;
                    //cev+=dizi[i][j];
                }
            }
        }
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                cev+=dizi[i][j];
            }
        }
        if(cev<=k){
            cout<<"DA"<<'\n';
            return 0;
        }
    }
    cout<<"NE"<<'\n';
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 3 ms 724 KB Output is correct
3 Correct 3 ms 724 KB Output is correct
4 Correct 9 ms 1108 KB Output is correct
5 Correct 3 ms 724 KB Output is correct
6 Correct 1 ms 596 KB Output is correct
7 Correct 5 ms 812 KB Output is correct
8 Correct 19 ms 1200 KB Output is correct
9 Correct 1 ms 468 KB Output is correct
10 Correct 20 ms 1252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 980 KB Output is correct
2 Correct 8 ms 1108 KB Output is correct
3 Correct 5 ms 980 KB Output is correct
4 Correct 5 ms 852 KB Output is correct
5 Correct 9 ms 1116 KB Output is correct
6 Correct 6 ms 852 KB Output is correct
7 Correct 16 ms 980 KB Output is correct
8 Correct 15 ms 1092 KB Output is correct
9 Correct 4 ms 724 KB Output is correct
10 Correct 21 ms 1236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1060 KB Output is correct
2 Correct 8 ms 1044 KB Output is correct
3 Correct 5 ms 852 KB Output is correct
4 Correct 6 ms 980 KB Output is correct
5 Correct 6 ms 980 KB Output is correct
6 Correct 21 ms 1280 KB Output is correct
7 Correct 5 ms 724 KB Output is correct
8 Correct 12 ms 980 KB Output is correct
9 Correct 13 ms 1056 KB Output is correct
10 Correct 22 ms 1304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 852 KB Output is correct
2 Correct 5 ms 852 KB Output is correct
3 Correct 13 ms 1220 KB Output is correct
4 Correct 4 ms 852 KB Output is correct
5 Correct 6 ms 960 KB Output is correct
6 Correct 21 ms 1276 KB Output is correct
7 Correct 6 ms 852 KB Output is correct
8 Correct 7 ms 852 KB Output is correct
9 Correct 10 ms 896 KB Output is correct
10 Correct 7 ms 852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 1236 KB Output is correct
2 Correct 10 ms 1176 KB Output is correct
3 Correct 9 ms 1236 KB Output is correct
4 Correct 6 ms 968 KB Output is correct
5 Correct 6 ms 980 KB Output is correct
6 Correct 13 ms 980 KB Output is correct
7 Correct 6 ms 804 KB Output is correct
8 Correct 17 ms 1108 KB Output is correct
9 Correct 9 ms 912 KB Output is correct
10 Correct 21 ms 1316 KB Output is correct