Submission #3775586
Source Code Expand
#include <iostream> #include <vector> #include <string> #include <map> #include <set> #include <stack> #include <queue> #include <cmath> #include <algorithm> #include <utility> #include <functional> #include <fstream> #define debug(x) cout << #x << " = " << x << endl #define FOR(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,n) for(int i = 0; i < (n); i++) #define repr(i,n) for(int i = (n); i > -1; i--) using namespace std; typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const double EPS = 1e-9; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin>>n; int f[n][10]; int p[n][11]; rep(i,n) { rep(j, 10) cin>>f[i][j]; } rep(i,n) { rep(j, 11) cin>>p[i][j]; } int mx = -MOD; for(int i = 1; i < (1<<10); i++) { int tmp = 0; rep(j,n) { int cnt = 0; rep(k, 10) { if((i>>k) % 2 == 1 && f[j][k] == 1) cnt++; } tmp += p[j][cnt]; } mx = max(mx, tmp); } cout << mx << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Shopping Street |
User | jumon |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1074 Byte |
Status | AC |
Exec Time | 3 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
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, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 3 ms | 256 KB |
02.txt | AC | 3 ms | 256 KB |
03.txt | AC | 3 ms | 256 KB |
04.txt | AC | 3 ms | 256 KB |
05.txt | AC | 3 ms | 256 KB |
06.txt | AC | 3 ms | 256 KB |
07.txt | AC | 3 ms | 256 KB |
08.txt | AC | 3 ms | 256 KB |
09.txt | AC | 3 ms | 256 KB |
10.txt | AC | 3 ms | 256 KB |
11.txt | AC | 3 ms | 256 KB |
12.txt | AC | 2 ms | 256 KB |
13.txt | AC | 2 ms | 256 KB |
14.txt | AC | 2 ms | 256 KB |
15.txt | AC | 3 ms | 256 KB |
16.txt | AC | 2 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |