| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 512503 | wildturtle | Sajam (COCI18_sajam) | C++14 | 292 ms | 3172 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define f first
#define sc second
#define pb push_back
using namespace std;
ll a,b,c,d,i,e,f,g,n,m,k,l,minn;
bitset<1000> A[1000];
string s[1003];
ll xorr(bitset<1000> x, bitset<1000> y){return min((ll)(x^y).count(), (ll)(n-(x^y).count()));}
ll go(ll x) {
ll cur=0;
for(ll i=1;i<=n;i++) {
if(i==x) continue;
cur+=xorr(A[i],A[x]);
}
return cur;
}
int main() {
cin>>n>>k;
for(ll i=1;i<=n;i++) {
cin>>s[i];
for(ll j=0;j<s[i].size();j++) {
A[i][j]=(s[i][j]=='x');
}
}
minn=1e18;
for(ll i=1;i<=n;i++) {
minn=min(minn,go(i));
}
if(n==k) {
for(ll j=0;j<n;j++) {
if(A[1][j]==0) A[1][j]=1;
else A[1][j]=0;
minn=min(minn,go(1)+1);
if(A[1][j]==0) A[1][j]=1;
else A[1][j]=0;
}
}
if(minn<=k) cout<<"DA";
else cout<<"NE";
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
