# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1077500 |
2024-08-27T07:43:18 Z |
vjudge1 |
Council (JOI23_council) |
C++17 |
|
1 ms |
348 KB |
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
//#define int long long
#define ll long long
typedef unsigned long long ull;
using namespace std;
const int N=3e5+5,M=1030;
int a[N],n,m,f[20],b[M];
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
cin>>n>>m;
for (int i=1;i<=n;i++){
for (int j=0;j<m;j++){
bool x;cin>>x;
if (x) a[i]|=(1<<j),f[j]++;
}
b[a[i]]++;
}
for (int i=1;i<=n;i++){
for (int j=0;j<m;j++) if (a[i]&(1<<j)) f[j]--;
b[a[i]]--;
int ans=0,x=0;
for (int j=0;j<m;j++) x+=(f[j]>=n/2);
for (int j=0;j<M;j++){
if (!b[j]) continue;
int y=x;
for (int k=0;k<m;k++) if ((j&(1<<j)) && f[k]==n/2) y--;
ans=max(ans,y);
}
for (int j=0;j<m;j++) if (a[i]&(1<<j)) f[j]++;
b[a[i]]++;
cout<<ans<<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |