Submission #38232
Source Code Expand
#include <cstdio> #include <vector> #include <deque> #include <queue> #include <map> #include <algorithm> #include <functional> #include <iostream> #include <string> #include <cmath> using namespace std; int main(void) { int N; cin >> N; vector<int> as(10); for(int i = 0; i < 10; ++i){ cin >> as[i]; } vector<int> succ(7, 0); vector<int> tmp(7, 0); for(int i = 0; i < N; ++i){ string str; cin >> str; for(int j = 0; j < 7; ++j){ if (str[j] == 'X'){ tmp[j]++; succ[j] = max(succ[j], tmp[j]); } else{ tmp[j] = 0; } } } // for(int j = 0; j < 7; ++j){ // cout << succ[j] << ", "; // } // cout << endl; sort(succ.begin(), succ.end()); sort(as.begin(), as.end()); int i = 0; int j = 0; while(1){ if (i == 7){ cout << "YES" << endl; return 0; } if (j == 10){ cout << "NO" << endl; return 0; } if (succ[i] <= as[j]){ ++i; ++j; } else{ ++j; } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - ビットマニア(BITMANIA) |
User | minus9d |
Language | C++ (G++ 4.6.4) |
Score | 1000 |
Code Size | 1300 Byte |
Status | AC |
Exec Time | 24 ms |
Memory | 808 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 1000 / 1000 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 23 ms | 772 KB |
02.txt | AC | 21 ms | 780 KB |
03.txt | AC | 23 ms | 784 KB |
04.txt | AC | 20 ms | 784 KB |
05.txt | AC | 20 ms | 768 KB |
06.txt | AC | 21 ms | 756 KB |
07.txt | AC | 20 ms | 788 KB |
08.txt | AC | 22 ms | 772 KB |
09.txt | AC | 21 ms | 776 KB |
10.txt | AC | 20 ms | 752 KB |
11.txt | AC | 22 ms | 784 KB |
12.txt | AC | 21 ms | 784 KB |
13.txt | AC | 23 ms | 764 KB |
14.txt | AC | 23 ms | 792 KB |
15.txt | AC | 22 ms | 772 KB |
16.txt | AC | 20 ms | 784 KB |
17.txt | AC | 22 ms | 808 KB |
18.txt | AC | 22 ms | 788 KB |
19.txt | AC | 21 ms | 772 KB |
20.txt | AC | 21 ms | 804 KB |
21.txt | AC | 23 ms | 768 KB |
22.txt | AC | 22 ms | 784 KB |
23.txt | AC | 24 ms | 772 KB |
24.txt | AC | 21 ms | 788 KB |
25.txt | AC | 21 ms | 784 KB |
26.txt | AC | 22 ms | 756 KB |
27.txt | AC | 22 ms | 784 KB |
28.txt | AC | 22 ms | 792 KB |
29.txt | AC | 20 ms | 788 KB |
30.txt | AC | 22 ms | 792 KB |
31.txt | AC | 22 ms | 780 KB |
32.txt | AC | 22 ms | 788 KB |
33.txt | AC | 21 ms | 784 KB |
34.txt | AC | 22 ms | 784 KB |