Submission #54609396


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ll long long
vector<int> IntegerToVector(int bit, int N) {
vector<int> S;
for (int i = 0; i < N; ++i) {
if (bit & (1 << i)) {
S.push_back(i);
}
}
return S;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int a,b;
cin >> a >> b;
vector<vector<char>> data(a, vector<char>(b));
rep(i,0,a){
rep(p,0,b){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ll long long
vector<int> IntegerToVector(int bit, int N) {
    vector<int> S;
    for (int i = 0; i < N; ++i) {
        if (bit & (1 << i)) {
            S.push_back(i);
        }
    }
    return S;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b;
  cin >> a >> b;
    vector<vector<char>> data(a, vector<char>(b));
    rep(i,0,a){
      rep(p,0,b){
        cin >> data[i][p];
      }
    }
  for (int bit = 0; bit < (1 << a); ++bit) {
        // どれを選ぶか
        vector<int> S = IntegerToVector(bit, a);
        vector<char> h(a);
        for (int i : S){
          rep(p,0,b){
            if(h[p] != 'o'&&data[i][p] == 'o'){
              h[p] = data[i][p];
            }
          }
        }

        int ans =0;
        rep(i,0,b){
          if(h[i] == 'o')ans++;
        }
        if (ans == b){
         cout << ans << endl;
         return 0;
        }
    }

}

Submission Info

Submission Time
Task C - Popcorn
User p2bananan
Language C++ 20 (gcc 12.2)
Score 0
Code Size 1041 Byte
Status WA
Exec Time 1 ms
Memory 3632 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
WA × 3
AC × 3
WA × 25
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 WA 1 ms 3628 KB
00_sample_01.txt WA 1 ms 3400 KB
00_sample_02.txt WA 1 ms 3432 KB
01_random_00.txt WA 1 ms 3448 KB
01_random_01.txt WA 1 ms 3424 KB
01_random_02.txt WA 1 ms 3504 KB
01_random_03.txt WA 1 ms 3348 KB
01_random_04.txt WA 1 ms 3628 KB
01_random_05.txt WA 1 ms 3500 KB
01_random_06.txt WA 1 ms 3440 KB
01_random_07.txt WA 1 ms 3564 KB
01_random_08.txt WA 1 ms 3632 KB
01_random_09.txt WA 1 ms 3476 KB
01_random_10.txt WA 1 ms 3432 KB
01_random_11.txt WA 1 ms 3400 KB
01_random_12.txt WA 1 ms 3448 KB
01_random_13.txt WA 1 ms 3360 KB
01_random_14.txt WA 1 ms 3432 KB
01_random_15.txt WA 1 ms 3364 KB
01_random_16.txt WA 1 ms 3632 KB
01_random_17.txt WA 1 ms 3500 KB
01_random_18.txt WA 1 ms 3508 KB
01_random_19.txt WA 1 ms 3496 KB
01_random_20.txt WA 1 ms 3432 KB
02_handmade_00.txt AC 1 ms 3508 KB
02_handmade_01.txt WA 1 ms 3496 KB
02_handmade_02.txt AC 1 ms 3572 KB
02_handmade_03.txt AC 1 ms 3356 KB


2025-04-03 (Thu)
22:14:00 +00:00