Submission #54602026
Source Code Expand
Copy
#include<iostream>#include<vector>#include<algorithm>#include<vector>#include<cmath>#include<set>#include<unordered_map>#include<string>#include<unordered_set>#include<queue>#include<stack>#define rep(i,n) for(int i=0;i<n;i++)using namespace std;typedef long long ll;typedef unsigned long long ull;int main(){int n,m;cin>>n>>m;vector<string> a(n);for(auto& i:a)
#include<iostream> #include<vector> #include<algorithm> #include<vector> #include<cmath> #include<set> #include<unordered_map> #include<string> #include<unordered_set> #include<queue> #include<stack> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { int n,m; cin>>n>>m; vector<string> a(n); for(auto& i:a) cin>>i; int mi=n+1; vector<bool> v(m); for(int bit=1;bit<(1<<n);bit++) { bool flag=false; for(int d=0;d<m;d++) v[d]=false; for(int i=0;i<n;i++) { if(bit&(1<<i)) { string str=a[i]; for(int j=0;j<m;j++) { if(str[j]=='o') v[j]=true; } bool f=true; for(auto k:v) { if(k==false) f=false; } if(f==true) { flag=true; break; } } } if(flag==true) { int tem; tem= __builtin_popcount(bit); mi=min(tem,mi); } } cout<<mi<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Popcorn |
User | turquoise |
Language | C++ 17 (gcc 12.2) |
Score | 300 |
Code Size | 1382 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3596 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3440 KB |
00_sample_01.txt | AC | 1 ms | 3444 KB |
00_sample_02.txt | AC | 1 ms | 3596 KB |
01_random_00.txt | AC | 1 ms | 3448 KB |
01_random_01.txt | AC | 1 ms | 3440 KB |
01_random_02.txt | AC | 1 ms | 3408 KB |
01_random_03.txt | AC | 1 ms | 3532 KB |
01_random_04.txt | AC | 1 ms | 3528 KB |
01_random_05.txt | AC | 1 ms | 3332 KB |
01_random_06.txt | AC | 1 ms | 3456 KB |
01_random_07.txt | AC | 1 ms | 3528 KB |
01_random_08.txt | AC | 1 ms | 3444 KB |
01_random_09.txt | AC | 1 ms | 3484 KB |
01_random_10.txt | AC | 1 ms | 3440 KB |
01_random_11.txt | AC | 1 ms | 3460 KB |
01_random_12.txt | AC | 1 ms | 3532 KB |
01_random_13.txt | AC | 1 ms | 3392 KB |
01_random_14.txt | AC | 1 ms | 3448 KB |
01_random_15.txt | AC | 1 ms | 3332 KB |
01_random_16.txt | AC | 1 ms | 3408 KB |
01_random_17.txt | AC | 1 ms | 3460 KB |
01_random_18.txt | AC | 1 ms | 3528 KB |
01_random_19.txt | AC | 1 ms | 3392 KB |
01_random_20.txt | AC | 1 ms | 3436 KB |
02_handmade_00.txt | AC | 1 ms | 3328 KB |
02_handmade_01.txt | AC | 1 ms | 3320 KB |
02_handmade_02.txt | AC | 1 ms | 3528 KB |
02_handmade_03.txt | AC | 1 ms | 3596 KB |