# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
777485 | 2023-07-09T09:34:02 Z | vjudge1 | Sajam (COCI18_sajam) | C++17 | 19 ms | 4932 KB |
#include<bits/stdc++.h> using namespace std; #define lalala ios_base::sync_with_stdio(false);cin.tie(NULL); //#define endl "\n" #define ll long long #define pb push_back #define N 1005 #define f first #define s second #define M 17 int dp[N]; int main(){ int n,k;cin>>n>>k; int arr[n][n]; for(int i=0;i<n;i++){ string str;cin>>str; for(int j=0;j<n;j++){ arr[i][j]==(str[j]=='o'); } } for(int uwu=0;uwu<2;uwu++){ for(int i=0;i<n;i++){ int bir=0; for(int j=0;j<n;j++){ bir+=arr[i][j]; } if(bir>n-bir){ for(int j=0;j<n;j++){ arr[i][j]^=1; } } } for(int i=0;i<n;i++){ int bir=0; for(int j=0;j<n;j++){ bir+=arr[j][i]; } if(bir>n-bir){ for(int j=0;j<n;j++){ arr[j][i]^=1; } } } } int bir=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ bir+=arr[i][j]; } } if(bir>n*n-bir)bir=n*n-bir; if(bir<=k)cout<<"DA"<<endl; else cout<<"NE"<<endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 4 ms | 1108 KB | Output is correct |
3 | Correct | 5 ms | 1492 KB | Output is correct |
4 | Correct | 16 ms | 4188 KB | Output is correct |
5 | Correct | 5 ms | 1620 KB | Output is correct |
6 | Correct | 2 ms | 724 KB | Output is correct |
7 | Incorrect | 5 ms | 1492 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Incorrect | 1 ms | 212 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 10 ms | 2972 KB | Output is correct |
2 | Correct | 19 ms | 3552 KB | Output is correct |
3 | Correct | 8 ms | 2516 KB | Output is correct |
4 | Correct | 7 ms | 2232 KB | Output is correct |
5 | Correct | 15 ms | 4052 KB | Output is correct |
6 | Incorrect | 6 ms | 1620 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 3820 KB | Output is correct |
2 | Correct | 14 ms | 3688 KB | Output is correct |
3 | Correct | 8 ms | 2300 KB | Output is correct |
4 | Correct | 10 ms | 2876 KB | Output is correct |
5 | Correct | 14 ms | 3028 KB | Output is correct |
6 | Incorrect | 17 ms | 4684 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 2260 KB | Output is correct |
2 | Correct | 8 ms | 2260 KB | Output is correct |
3 | Correct | 18 ms | 4760 KB | Output is correct |
4 | Correct | 6 ms | 1620 KB | Output is correct |
5 | Correct | 9 ms | 2316 KB | Output is correct |
6 | Incorrect | 17 ms | 4692 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 18 ms | 4932 KB | Output is correct |
2 | Correct | 17 ms | 4692 KB | Output is correct |
3 | Correct | 16 ms | 4356 KB | Output is correct |
4 | Correct | 10 ms | 2644 KB | Output is correct |
5 | Correct | 10 ms | 2752 KB | Output is correct |
6 | Incorrect | 11 ms | 2852 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |