답안 #884159

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
884159 2023-12-06T16:25:24 Z vjudge1 Sajam (COCI18_sajam) C++17
15 / 90
8 ms 1596 KB
#include <bits/stdc++.h>
using namespace std;
#define sp << " " << 
#define int long long
#define vi vector<int>
#define F(xxx,yyy) for (int xxx=1;xxx<=yyy;xxx++)
#define pii pair<int,int>
const int N = 2e5+1;

void solve() {
  int n,k;
  cin >> n >> k;
  char grid[n+1][n+1];
  map<vector<int>,int> mp;
  F(i,n) {
    string s;
    cin >> s;
    if (s[0] == 'x') for (auto& it : s) it = (it=='o'?'x':'o');
    vector<int> v;
    for (auto it : s) if (it == 'o') v.push_back(it);
    mp[v]++;
  }
  if (mp.rbegin()->second >= n-k) cout << "DA\n";
  else cout << "NE\n";
}
    
                  
                             
signed main() { 
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  #ifdef Local
  freopen("in","r",stdin);
  freopen("out","w",stdout); 
  #endif
  int t = 1;
  //cin >> t;
	F(i,t) solve();
}

Compilation message

sajam.cpp: In function 'void solve()':
sajam.cpp:13:8: warning: unused variable 'grid' [-Wunused-variable]
   13 |   char grid[n+1][n+1];
      |        ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 3 ms 1232 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 3 ms 604 KB Output is correct
8 Correct 8 ms 1596 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 8 ms 1580 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 860 KB Output is correct
2 Correct 2 ms 780 KB Output is correct
3 Correct 4 ms 1372 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
5 Correct 2 ms 860 KB Output is correct
6 Incorrect 5 ms 1372 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1372 KB Output is correct
2 Correct 5 ms 1372 KB Output is correct
3 Correct 4 ms 1240 KB Output is correct
4 Correct 3 ms 856 KB Output is correct
5 Correct 3 ms 1132 KB Output is correct
6 Incorrect 3 ms 860 KB Output isn't correct
7 Halted 0 ms 0 KB -