답안 #776722

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
776722 2023-07-08T07:51:54 Z vjudge1 Sajam (COCI18_sajam) C++17
45 / 90
15 ms 4464 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

int32_t main(){
    faster
    int n,k;
    cin>>n>>k;
    string s[n],ger[n],sor1[n];
    int cev=0,xi=0,oi=0;
    for(int i=0;i<n;i++){
        cin>>s[i];
        string f="";
        for(int j=0;j<n;j++){
            if(s[i][j]=='x'){
                f+='o';
            }
            else f+='x';
        }
        ger[i]=f;
    }
    int gec=n*n;
    if(gec%2!=0)gec++;
    gec/=2;
    if(k>=gec){
        cout<<"DA"<<'\n';
    }
    else{
    for(int i=0;i<n;i++){
        if(ger[i][0]=='o'){
            sor1[i]=ger[i];
        }
        else{
            sor1[i]=s[i];
        }
    }
    bool stop=true;
    int gec=OYY;
    for(int i=0;i<n;i++){
        gec=OYY;
        xi=0,oi=0;
        for(int j=0;j<n;j++){
            if(sor1[j][i]=='x')xi++;
            else oi++;
            //cout<<sor1[j][i]<<" ";
        }
        //cout<<endl;
        gec=min(oi,xi);
        cev+=gec;
        //cout<<cev<<" "<<oi<<" "<<xi<<'\n';
    }
    if(cev<=k)cout<<"DA"<<'\n';
    else cout<<"NE"<<'\n';
    }
    return 0;
}

Compilation message

sajam.cpp: In function 'int32_t main()':
sajam.cpp:41:10: warning: unused variable 'stop' [-Wunused-variable]
   41 |     bool stop=true;
      |          ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 316 KB Output is correct
2 Correct 2 ms 980 KB Output is correct
3 Correct 2 ms 1236 KB Output is correct
4 Correct 5 ms 3060 KB Output is correct
5 Correct 3 ms 1264 KB Output is correct
6 Correct 1 ms 724 KB Output is correct
7 Correct 4 ms 1236 KB Output is correct
8 Correct 13 ms 3176 KB Output is correct
9 Correct 1 ms 468 KB Output is correct
10 Correct 13 ms 3296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Incorrect 1 ms 320 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 2304 KB Output is correct
2 Correct 5 ms 2692 KB Output is correct
3 Correct 3 ms 1972 KB Output is correct
4 Correct 3 ms 1748 KB Output is correct
5 Correct 6 ms 3004 KB Output is correct
6 Correct 3 ms 1352 KB Output is correct
7 Correct 4 ms 2268 KB Output is correct
8 Correct 4 ms 2384 KB Output is correct
9 Correct 3 ms 852 KB Output is correct
10 Correct 15 ms 4464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 2824 KB Output is correct
2 Correct 5 ms 2796 KB Output is correct
3 Correct 3 ms 1856 KB Output is correct
4 Correct 4 ms 2248 KB Output is correct
5 Correct 4 ms 2288 KB Output is correct
6 Correct 6 ms 3336 KB Output is correct
7 Correct 2 ms 1108 KB Output is correct
8 Correct 4 ms 2180 KB Output is correct
9 Correct 9 ms 2232 KB Output is correct
10 Correct 15 ms 4464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 1748 KB Output is correct
2 Correct 4 ms 1912 KB Output is correct
3 Incorrect 7 ms 4364 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 4432 KB Output is correct
2 Correct 7 ms 4296 KB Output is correct
3 Incorrect 6 ms 3188 KB Output isn't correct
4 Halted 0 ms 0 KB -