# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
777412 | 2023-07-09T08:11:08 Z | vjudge1 | Sajam (COCI18_sajam) | C++17 | 151 ms | 2260 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(){ clock_t start,end; start=clock(); 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=100; 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'; end=clock(); double tita=double(end-start)/double(CLOCKS_PER_SEC); //cout<<fixed<<tita<<setprecision(5); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 2 ms | 852 KB | Output is correct |
3 | Correct | 4 ms | 1052 KB | Output is correct |
4 | Correct | 16 ms | 2024 KB | Output is correct |
5 | Correct | 4 ms | 980 KB | Output is correct |
6 | Correct | 2 ms | 724 KB | Output is correct |
7 | Correct | 30 ms | 984 KB | Output is correct |
8 | Correct | 124 ms | 2072 KB | Output is correct |
9 | Correct | 7 ms | 596 KB | Output is correct |
10 | Correct | 123 ms | 2092 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 328 KB | Output is correct |
5 | Correct | 1 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 340 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 1480 KB | Output is correct |
2 | Correct | 8 ms | 1748 KB | Output is correct |
3 | Correct | 6 ms | 1364 KB | Output is correct |
4 | Correct | 5 ms | 1236 KB | Output is correct |
5 | Correct | 9 ms | 2004 KB | Output is correct |
6 | Correct | 35 ms | 1108 KB | Output is correct |
7 | Correct | 75 ms | 1576 KB | Output is correct |
8 | Correct | 86 ms | 1620 KB | Output is correct |
9 | Correct | 20 ms | 852 KB | Output is correct |
10 | Correct | 138 ms | 2260 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 1796 KB | Output is correct |
2 | Correct | 9 ms | 1876 KB | Output is correct |
3 | Correct | 5 ms | 1372 KB | Output is correct |
4 | Correct | 6 ms | 1484 KB | Output is correct |
5 | Correct | 8 ms | 1628 KB | Output is correct |
6 | Correct | 127 ms | 2132 KB | Output is correct |
7 | Correct | 27 ms | 972 KB | Output is correct |
8 | Correct | 70 ms | 1492 KB | Output is correct |
9 | Correct | 78 ms | 1620 KB | Output is correct |
10 | Correct | 151 ms | 2248 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 1368 KB | Output is correct |
2 | Correct | 7 ms | 1364 KB | Output is correct |
3 | Correct | 12 ms | 2244 KB | Output is correct |
4 | Correct | 4 ms | 1112 KB | Output is correct |
5 | Correct | 6 ms | 1300 KB | Output is correct |
6 | Correct | 128 ms | 2092 KB | Output is correct |
7 | Correct | 33 ms | 1108 KB | Output is correct |
8 | Correct | 39 ms | 1176 KB | Output is correct |
9 | Correct | 47 ms | 1200 KB | Output is correct |
10 | Correct | 38 ms | 1108 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 2160 KB | Output is correct |
2 | Correct | 11 ms | 2132 KB | Output is correct |
3 | Correct | 10 ms | 1984 KB | Output is correct |
4 | Correct | 6 ms | 1492 KB | Output is correct |
5 | Correct | 6 ms | 1476 KB | Output is correct |
6 | Correct | 81 ms | 1492 KB | Output is correct |
7 | Correct | 35 ms | 1120 KB | Output is correct |
8 | Correct | 105 ms | 1920 KB | Output is correct |
9 | Correct | 60 ms | 1356 KB | Output is correct |
10 | Correct | 127 ms | 2144 KB | Output is correct |