buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <bits/stdc++.h>
const int MAX_RC = 7;
int R, C, K;
char grid[MAX_RC][MAX_RC];
char gg[MAX_RC][MAX_RC];
int count() {
int ans = 0;
for (int r = 0; r < R; ++r)
for (int c = 0; c < C; ++c)
ans += (gg[r][c] == '#');
return ans;
}
int main() {
scanf("%d %d %d ", &R, &C, &K);
for (int r = 0; r... | #include <bits/stdc++.h>
const int MAX_RC = 7;
int R, C, K;
char grid[MAX_RC][MAX_RC];
char gg[MAX_RC][MAX_RC];
int count() {
int ans = 0;
for (int r = 0; r < R; ++r)
for (int c = 0; c < C; ++c)
ans += (gg[r][c] == '#');
return ans;
}
int main() {
scanf("%d %d %d ", &R, &C, &K);
for (int r = 0; r... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 351 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
cin >> n >> m;
vector<string> v(n);
for (int i = 0; i < n; i++)
cin >> v[i];
int result = 0;
for (int mask_i = 0; mask_i < (1 << n); mask_i++) {
for (int mask_j = 0; mask_j < (1 << m); mask_j++) {
int black = 0;
for... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
cin >> n >> m >> k;
vector<string> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
// cout << v[i] << endl;
}
int result = 0;
for (int mask_i = 0; mask_i < (1 << n); mask_i++) {
for (int mask_j = 0; mask_j < (1 << m);... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 196 |
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1001001001;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<vector<int>> c(H, vector<int>(W));
rep(i, H) {
rep(j, W) { cin >> c[i][j]; }
... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1001001001;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<vector<char>> c(H, vector<char>(W));
rep(i, H) {
rep(j, W) { cin >> c[i][j]; ... | [["-", 0, 77, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 77, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 56, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 56, 39, 344, 3, 347, 0, 77, 39, 40]] | 1 | 227 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int main() {
int h, w, k, a = 0;
cin >> h >> w >> k;
vector<string> v(h);
rep(i, h) cin >> v[i];
rep(i, 1 << (h + w)) {
int tmp = 0;
rep(j, h) {
rep(l, w) {
if (i & 1 << j || i & 1 << (l + w))
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
int main() {
int h, w, k, a = 0;
cin >> h >> w >> k;
vector<string> v(h);
rep(i, h) cin >> v[i];
rep(i, 1 << (h + w)) {
int tmp = 0;
rep(j, h) {
rep(l, w) {
if (i & 1 << j || i & 1 << (l + h))
... | [["-", 12, 16, 12, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 12, 22]] | 1 | 156 |
#include <iostream>
#include <vector>
int main() {
int H, W, K;
std::cin >> H >> W >> K;
std::vector<std::vector<char>> c(W, std::vector<char>(H, 0));
int blackCount = 0;
std::vector<int> hBlackCount(H, 0);
std::vector<int> vBlackCount(W, 0);
for (int i = 0; i != H; i++) {
for (int j = 0; j != W; j+... | #include <iostream>
#include <vector>
int main() {
int H, W, K;
std::cin >> H >> W >> K;
std::vector<std::vector<char>> c(H, std::vector<char>(W, 0));
int blackCount = 0;
std::vector<int> hBlackCount(H, 0);
std::vector<int> vBlackCount(W, 0);
for (int i = 0; i != H; i++) {
for (int j = 0; j != W; j+... | [["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22], ["-", 49, 50, 51, 4, 0, 2, 3, 4, 0, 22], ["+", 49, 50, 51, 4, 0, 2, 3, 4, 0, 22]] | 1 | 380 |
#include <bits/stdc++.h>
using namespace std;
int h, w, k;
char c[6][6];
char temp[6][6];
void copy() {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++)
temp[i][j] = c[i][j];
}
}
void color(int i, int j) {
for (int x = 0; x < h; x++) {
if (i & (1 << x)) {
for (int y = 0; y < w; y++)
... | #include <bits/stdc++.h>
using namespace std;
int h, w, k;
char c[6][6];
char temp[6][6];
void copy() {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++)
temp[i][j] = c[i][j];
}
}
void color(int i, int j) {
for (int x = 0; x < h; x++) {
if (i & (1 << x)) {
for (int y = 0; y < w; y++)
... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 412 |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define FOR(i, N) for (long i = 0; i < (N); i++)
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int H, W, K;
cin >> H >> W >> K;
vector<string> masu(H);
string str;
FOR(h, H) { cin >> masu[h]; }
int ans = 0;
FOR(i, (1 << H))... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define FOR(i, N) for (long i = 0; i < (N); i++)
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int H, W, K;
cin >> H >> W >> K;
vector<string> masu(H);
string str;
FOR(h, H) { cin >> masu[h]; }
int ans = 0;
FOR(i, (1 << H))... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 67]] | 1 | 190 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, k;
cin >> h >> w >> k;
char a[h][w];
for (int i = 0; i < h; ++i)
for (int j = 0; j < w; ++j)
cin >> a[i][j];
int ans = 0, black;
for (int maskr = 0; maskr < (1 << h); ++maskr) {
for (int maskc = 0; maskc < (1 << w); ++maskc)... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, k;
cin >> h >> w >> k;
char a[h][w];
for (int i = 0; i < h; ++i)
for (int j = 0; j < w; ++j)
cin >> a[i][j];
int ans = 0, black;
for (int maskr = 0; maskr < (1 << h); ++maskr) {
for (int maskc = 0; maskc < (1 << w); ++maskc)... | [["-", 31, 16, 12, 16, 31, 23, 0, 16, 17, 98], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 67]] | 1 | 212 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define mod 1000000000000000007
#define pi 3.1415926535897932384626433832795
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define vecsort(v) sort(v.begin(), v.end())
#define lcm(x, y) (x / __gcd(x, y)) * y
#define forn(i, n) for ... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define mod 1000000000000000007
#define pi 3.1415926535897932384626433832795
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define vecsort(v) sort(v.begin(), v.end())
#define lcm(x, y) (x / __gcd(x, y)) * y
#define forn(i, n) for ... | [["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 9, 0, 37, 0, 38], ["+", 0, 57, 75, 76, 0, 9, 0, 37, 0, 147], ["+", 0, 57, 75, 76, 0, 9, 0, 37, 0, 35], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 488 |
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define reps(i, n) for (ll i = 1, i##_len = (n); i <= i##_len; ++i)
#define rrep(i, n) for (ll i = ((int)(n)-1); i >= 0; --i)
#define rreps(i, n) for (ll i = ((int)(n)); i > 0; --i)
#define ll long long
#define ALL(x) (x).begin(), (x).end()
#define... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define reps(i, n) for (ll i = 1, i##_len = (n); i <= i##_len; ++i)
#define rrep(i, n) for (ll i = ((int)(n)-1); i >= 0; --i)
#define rreps(i, n) for (ll i = ((int)(n)); i > 0; --i)
#define ll long long
#define ALL(x) (x).begin(), (x).end()
#define... | [["+", 0, 57, 15, 339, 51, 16, 31, 91, 17, 111], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111]] | 1 | 368 |
#include <iostream>
#include <stdio.h>
#include <vector>
const static int MAX = 6;
int A[MAX][MAX], B[MAX][MAX];
int h, w, k, cnt, ans;
std::vector<int> bit;
int bit_search(int a, int m) {
if (a == m) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
B[i][j] = A[i][j];
}
}
... | #include <iostream>
#include <stdio.h>
#include <vector>
const static int MAX = 6;
int A[MAX][MAX], B[MAX][MAX];
int h, w, k, cnt, ans;
std::vector<int> bit;
int bit_search(int a, int m) {
if (a == m) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
B[i][j] = A[i][j];
}
}
... | [["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]] | 1 | 470 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, n) for (int i = 1; i <= (n); ++i)
#define all(x) (x).begin(), (x).end()
#define Fixed fixed << setprecision(12)
#define int int_fast64_t
using pii = pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr l... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, n) for (int i = 1; i <= (n); ++i)
#define all(x) (x).begin(), (x).end()
#define Fixed fixed << setprecision(12)
#define int int_fast64_t
using pii = pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr l... | [["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]] | 1 | 463 |
// H and V
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(void) {
// Your code here!
int h, w, k;
cin >> h >> w >> k;
char c[h][w];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> c[h][w];
}
}
... | // H and V
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(void) {
// Your code here!
int h, w, k;
cin >> h >> w >> k;
char c[h][w];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> c[i][j];
}
}
... | [["-", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22]] | 1 | 245 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
int main(void) {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
int ans... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
int main(void) {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
int ans... | [["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 8, 9, 0, 57, 64, 9, 0, 116, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45]] | 1 | 232 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++)
cin >> s[i];
int ans = 0;
for (int x = 0; x < (1 << h); x++) {
for (int y = 0; y < (1 << w); y++) {
vector<string> t = s... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++)
cin >> s[i];
int ans = 0;
for (int x = 0; x < (1 << h); x++) {
for (int y = 0; y < (1 << w); y++) {
vector<string> t = s... | [["-", 64, 1, 0, 11, 31, 69, 28, 69, 28, 22], ["+", 64, 1, 0, 11, 31, 69, 28, 69, 28, 22], ["-", 15, 339, 51, 16, 31, 69, 28, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 28, 69, 28, 22]] | 1 | 248 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> c(h);
int ans = 0;
rep(i, h) cin >> c[i];
rep(i0, 1 << h) {
rep(j0, 1 << w) {
int count = 0;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> c(h);
int ans = 0;
rep(i, h) cin >> c[i];
rep(i0, 1 << h) {
rep(j0, 1 << w) {
int count = 0;
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 67]] | 1 | 177 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, k, ans = 0;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
for (int is = 0; is < (1 << h); is++) {
for (int js = 0; js < (1 << w); js++) {
int cnt = 0;
for (int i = 0; i < h; i++)... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, k, ans = 0;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
for (int is = 0; is < (1 << h); is++) {
for (int js = 0; js < (1 << w); js++) {
int cnt = 0;
for (int i = 0; i < h; i++)... | [["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 196 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<string> s(H);
for (int i = 0; i < H; i++) {
cin >> s[i];
}
int ans = 0;
for (int is = 0; is < 1 << H; is++) {
for (int js = 0; js < 1 << W; js++) {
int cnt = 0;... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<string> s(H);
for (int i = 0; i < H; i++) {
cin >> s[i];
}
int ans = 0;
for (int is = 0; is < 1 << H; is++) {
for (int js = 0; js < 1 << W; js++) {
int cnt = 0;... | [["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]] | 1 | 193 |
#include <bits/stdc++.h>
using namespace std;
using llong = long long int;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
const static int MOD = 1000000007;
const static in... | #include <bits/stdc++.h>
using namespace std;
using llong = long long int;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
const static int MOD = 1000000007;
const static in... | [["+", 8, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25]] | 1 | 332 |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main() {
int H, W, K;
std::cin >> H >> W >> K;
std::vector<std::vector<int>> M(H, std::vector<int>(W));
for (auto i{0}; i < H; ++i)
for (auto j{0}; j < W; ++j)
std::cin >> M[i][j];
int ans = 0;
for (int bit_h = 0; bi... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main() {
int H, W, K;
std::cin >> H >> W >> K;
std::vector<std::vector<char>> M(H, std::vector<char>(W));
for (auto i{0}; i < H; ++i)
for (auto j{0}; j < W; ++j)
std::cin >> M[i][j];
int ans = 0;
for (int bit_h = 0; ... | [["-", 39, 343, 141, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 343, 141, 344, 3, 347, 0, 77, 39, 40]] | 1 | 236 |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int c(int h, int w, int k, vector<string> cc) {
int res = 0;
for (int i = 0; i < (1 << h); i++) {
for (int j = 0; j < (1 << w); j++) {
// cout << i << " " << j << endl;
int count = 0;
for (int a = 0; a < h; a++) {
for... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int c(int h, int w, int k, vector<string> cc) {
int res = 0;
for (int i = 0; i < (1 << h); i++) {
for (int j = 0; j < (1 << w); j++) {
// cout << i << " " << j << endl;
int count = 0;
for (int a = 0; a < h; a++) {
for... | [["-", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125]] | 1 | 237 |
//ビット全探索
#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf{int(1e9)};
int main(void) {
int H, W, K;
cin >> H >> W >> K;
vector<string> c(H);
rep(i, H) cin >> c[i];
int ... | //ビット全探索
#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf{int(1e9)};
int main(void) {
int H, W, K;
cin >> H >> W >> K;
vector<string> c(H);
rep(i, H) cin >> c[i];
int ... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 189 |
#include <iostream>
#include <set>
#include <vector>
using namespace std;
// int dfs(vector<vector<char>> &v, int i, int j, int h, int w, set<int> rows,
// set<int> cols, int k)
// {
// if (i >= h || j >= w)
// {
// cout << i << ' ' << j << endl;
// for (auto e : rows) cout << e << ' ';
// ... | #include <iostream>
#include <set>
#include <vector>
using namespace std;
// int dfs(vector<vector<char>> &v, int i, int j, int h, int w, set<int> rows,
// set<int> cols, int k)
// {
// if (i >= h || j >= w)
// {
// cout << i << ' ' << j << endl;
// for (auto e : rows) cout << e << ' ';
// ... | [["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 270 |
#include <cstdio>
#include <iostream>
using namespace std;
const int N = 8;
int n, m, w, ans;
char g[N][N];
int main() {
scanf("%d%d%d", &n, &m, &w);
for (int i = 0; i < n; i++)
scanf("%s", g[i]);
for (int i = 0, cnt; i < 1 << n; i++)
for (int j = 0; j < 1 << m; j++) {
cnt = 0;
for (int a ... | #include <cstdio>
#include <iostream>
using namespace std;
const int N = 8;
int n, m, w, ans;
char g[N][N];
int main() {
scanf("%d%d%d", &n, &m, &w);
for (int i = 0; i < n; i++)
scanf("%s", g[i]);
for (int i = 0, cnt; i < 1 << n; i++)
for (int j = 0; j < 1 << m; j++) {
cnt = 0;
for (int a ... | [["+", 15, 339, 51, 16, 31, 16, 31, 91, 17, 111], ["-", 51, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["-", 15, 339, 51, 16, 31, 23, 0, 16, 17, 106], ["+", 8, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 16, 12, 91, 17, 111], ["-", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25]] | 1 | 205 |
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
ll n, m, k;
char a[6][6];
bool check(ll r, ll c) {
ll cont = 0;
for (ll i = 0; i < n; i++)
for (ll j = 0; j < m; j++) {
if (1 & (1 << i) || 1 & (1 << j))
continue;
else if (a[i][j] == '#')
cont++;
}
if (cont... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
ll n, m, k;
char a[6][6];
bool check(ll r, ll c) {
ll cont = 0;
for (ll i = 0; i < n; i++)
for (ll j = 0; j < m; j++) {
if (r & (1 << i) || c & (1 << j))
continue;
else if (a[i][j] == '#')
cont++;
}
if (cont... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]] | 1 | 244 |
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
vector<string> st2;
int bk = 0;
int res;
int main() {
int h, w, kk;
cin >> h >> w >> kk;
for (int i = 0; i < h; i++) {
string ww;
cin >> ww;
for (int i = 0; i < ww.size(); i++) {
if (ww[i] == '#')
bk++;
... | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
vector<string> st2;
int bk = 0;
int res;
int main() {
int h, w, kk;
cin >> h >> w >> kk;
for (int i = 0; i < h; i++) {
string ww;
cin >> ww;
for (int j = 0; j < ww.size(); j++) {
if (ww[j] == '#')
bk++;
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 7, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 7, 26, 27, 28, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 1... | 1 | 332 |
H, W, K = map(int, input().split())
cw = [input() for i in range(H)]
cnt = 0
for cols in range(H**2):
for rows in range(W**2):
black = 0
for i in range(H):
for j in range(W):
if ((cols >> i) & 1) == 0 and ((rows >> j) & 1) == 0:
if cw[i][j] == '#':
... | H, W, K = map(int, input().split())
cw = [input() for i in range(H)]
cnt = 0
for cols in range(2**H):
for rows in range(2**W):
black = 0
for i in range(H):
for j in range(W):
if ((cols >> i) & 1) == 0 and ((rows >> j) & 1) == 0:
if cw[i][j] == '#':
... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 578], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 578], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 22]] | 5 | 127 |
#include <bits/stdc++.h> //全てのヘッダファイルをインクルード
//ループ
#define rep(i, n) for (int i = 0; i < (n); i++) //普通のループ
#define repr(i, n) for (int i = n; i >= 0; i--) //逆ループ
//型名省略
typedef long long ll;
//値
static const ll MX = 100005;
static const ll MX_ll = 1e18;
using namespace std;
//#include "./lib/generic/search.h"
int... | #include <bits/stdc++.h> //全てのヘッダファイルをインクルード
//ループ
#define rep(i, n) for (int i = 0; i < (n); i++) //普通のループ
#define repr(i, n) for (int i = n; i >= 0; i--) //逆ループ
//型名省略
typedef long long ll;
//値
static const ll MX = 100005;
static const ll MX_ll = 1e18;
using namespace std;
//#include "./lib/generic/search.h"
int... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]] | 1 | 194 |
#include <bits/stdc++.h>
using namespace std;
#define start \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define f(i, a, n... | #include <bits/stdc++.h>
using namespace std;
#define start \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define f(i, a, n... | [["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25]] | 1 | 256 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
#define repi(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, a) repi(i, 0, a)
#define rrep(i, a) for (ll i = a - 1; i >= 0; i--)
#define MOD 1000000007
// debug
#define debug(arr) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
#define repi(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, a) repi(i, 0, a)
#define rrep(i, a) for (ll i = a - 1; i >= 0; i--)
#define MOD 1000000007
// debug
#define debug(arr) ... | [["-", 15, 339, 51, 16, 31, 23, 0, 16, 17, 106], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 17, 98]] | 1 | 206 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
using p = pair<int, int>;
using ll = long long;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h) cin >> s[i];
int ans = 0;
r... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
using p = pair<int, int>;
using ll = long long;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h) cin >> s[i];
int ans = 0;
r... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60]] | 1 | 187 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
char C[H][W];
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
cin >> C[i][j];
int res = 0;
for (int bit = 0; bit < (1 << H); bit++) {
for (int bit2 = 0; bit < (1 << W); bit++) {
... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
char C[H][W];
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
cin >> C[i][j];
int res = 0;
for (int bit = 0; bit < (1 << H); bit++) {
for (int bit2 = 0; bit2 < (1 << W); bit2++) {... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 7, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 7, 26, 27, 28, 22], ["-", 0, 11, 31, 69, 341, 342, 0, 69, 28, 22], ["+", 0, 11, 31, 69, 341, 342, 0, 69, 28, 22]] | 1 | 423 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<vector<char>> t(H, vector<char>(W));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> t.at(i).at(j);
}
}
int p = 0;
for (int i = 0; i < (1 << H); i++) {
for (int j = ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<vector<char>> t(H, vector<char>(W));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> t.at(i).at(j);
}
}
int p = 0;
for (int i = 0; i < (1 << H); i++) {
for (int j = ... | [["+", 51, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24]] | 1 | 240 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, s, n) for (int i = s; i < n; i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using Graph = vector<vector<int>>;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, s, n) for (int i = s; i < n; i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using Graph = vector<vector<int>>;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h)... | [["+", 64, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 0, 9, 0, 57, 64, 57, 15, 339, 0, 25], ["-", 12, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 12, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 34, 12, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 34, 12, 11, 31, 69, 341, 342, 0, 22]] | 1 | 329 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
char g[10][10];
bool visx[10], visy[10];
for (int i = 0; i < H; ++i)
scanf("%s", g[i]);
int ans = 0;
for (int mask = 1; mask < (1 << (H + W)); ++mask) {
memset(visx, 0, sizeof(visx));
memset(visy, 0, ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, K;
cin >> H >> W >> K;
char g[10][10];
bool visx[10], visy[10];
for (int i = 0; i < H; ++i)
scanf("%s", g[i]);
int ans = 0;
for (int mask = 0; mask < (1 << (H + W)); ++mask) {
memset(visx, 0, sizeof(visx));
memset(visy, 0, ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 285 |
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define W(x, y) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << y;
#else
#define W(x, y)
#endif
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vii vector<pii>
#define vl vector<ll>
#define vll vector<pll>
// ... | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define W(x, y) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << y;
#else
#define W(x, y)
#endif
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vii vector<pii>
#define vl vector<ll>
#define vll vector<pll>
// ... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 504 |
//*****Jai Mata di*****//
#include <bits/stdc++.h>
using namespace std;
#define Nitroboost \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
co... | //*****Jai Mata di*****//
#include <bits/stdc++.h>
using namespace std;
#define Nitroboost \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
co... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33]] | 1 | 329 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef set<int> se;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define Fn 1.618033987
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef set<int> se;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define Fn 1.618033987
... | [["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 301 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define ld long double
#define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpii vector<pii>
#define gr vector<vpii>
#define str string
#define mask ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define ld long double
#define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpii vector<pii>
#define gr vector<vpii>
#define str string
#define mask ... | [["-", 31, 16, 12, 91, 28, 23, 0, 16, 17, 98], ["+", 31, 16, 12, 91, 28, 23, 0, 16, 17, 67]] | 1 | 484 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h) cin >> s[i];
int ans = 0;
rep(is, 1 << h) rep(js, 1 << w) {
int cnt = 0;
rep(i, h) rep(j, w) {
if... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h) cin >> s[i];
int ans = 0;
rep(is, 1 << h) rep(js, 1 << w) {
int cnt = 0;
rep(i, h) rep(j, w) {
if... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60]] | 1 | 162 |
#include <bits/stdc++.h>
using namespace std;
int n, m, k;
string grid[10];
int main(void) {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> k;
for (int i = 0; i < n; i++)
cin >> grid[i];
int res = 0;
int la = (1 << n), lb = (1 << m);
for (int r = 0; r < la; r++) {
for (int c = 0; c < ... | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
string grid[10];
int main(void) {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> k;
for (int i = 0; i < n; i++)
cin >> grid[i];
int res = 0;
int la = (1 << n), lb = (1 << m);
for (int r = 0; r < la; r++) {
for (int c = 0; c < ... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 221 |
#include <bits/stdc++.h>
#define pii pair<int, int>
#define fi first
#define se second
#define int long long
#define pb push_back
#define mod 1000000007
#define pll pair<long long, long long>
using namespace std;
long long power(long long a, long long b) {
long long ans = 1;
while (b > 0) {
if (b & 1) {
a... | #include <bits/stdc++.h>
#define pii pair<int, int>
#define fi first
#define se second
#define int long long
#define pb push_back
#define mod 1000000007
#define pll pair<long long, long long>
using namespace std;
long long power(long long a, long long b) {
long long ans = 1;
while (b > 0) {
if (b & 1) {
a... | [["-", 15, 339, 51, 16, 31, 69, 28, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 28, 69, 28, 22]] | 1 | 430 |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h) cin >> s[i];
int ans = 0;
rep(is, 1 << h) rep(js, 1 << w) {
int cnt = 0;
r... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
rep(i, h) cin >> s[i];
int ans = 0;
rep(is, 1 << h) rep(js, 1 << w) {
int cnt = 0;
r... | [["-", 51, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["+", 51, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22]] | 1 | 164 |
// AtCoder template
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
bool isRed(int i, int j, int bitw, int bith) {
if (((1 << i) & bith) || ((1 << j) & bitw))
return true;
else
return false;
}
int main() {
cin.tie(0);
ios::sync_with_std... | // AtCoder template
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
bool isRed(int i, int j, int bith, int bitw) {
if (((1 << i) & bith) || ((1 << j) & bitw))
return true;
else
return false;
}
int main() {
cin.tie(0);
ios::sync_with_std... | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 49, 22], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 49, 22]] | 1 | 234 |
#include <bits/stdc++.h>
using namespace std;
int h, w, k, black = 0;
char arr[6][6];
char brr[6][6];
void copy_array() {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
brr[i][j] = arr[i][j];
}
}
}
bool check_array(int i, int j) {
for (int x = 0; x < h; x++) {
if (i & (1 << x)) {
... | #include <bits/stdc++.h>
using namespace std;
int h, w, k, black = 0;
char arr[6][6];
char brr[6][6];
void copy_array() {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
brr[i][j] = arr[i][j];
}
}
}
bool check_array(int i, int j) {
for (int x = 0; x < h; x++) {
if (i & (1 << x)) {
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 448 |
h,w,k=map(int,input().split())
c=[input() for _ in range(h)]
count=0
for H in range(h<<1):
for W in range(w<<1):
b=0
for i in range(h):
for j in range(w):
if (H >> i) & 1 == 0 and (W >> j) & 1 == 0 and c[i][j] == "#":
b+=1
if b==k:
count+=1
print(count) | h,w,k=map(int,input().split())
c=[input() for _ in range(h)]
count=0
for H in range(1<<h):
for W in range(1<<w):
b=0
for i in range(h):
for j in range(w):
if (H >> i) & 1 == 0 and (W >> j) & 1 == 0 and c[i][j] == "#":
b+=1
if b==k:
count+=1
print(count) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 151], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 151], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 22]] | 5 | 122 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
int ans = 0;
for (int is = 0; is < 1 << h; is++) {
for (int js = 0; js < 1 << w; js++) {
int cnt = 0;
for (int i = 0; i < h... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
int ans = 0;
for (int is = 0; is < 1 << h; is++) {
for (int js = 0; js < 1 << w; js++) {
int cnt = 0;
for (int i = 0; i < h... | [["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 192 |
#include <bits/stdc++.h>
// #define int long long
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repa(i, s, n) for (int i = s; i < (int)n; i++)
using namespace std;
using ll = long long;
typedef vector<int> vi;
signed main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
int ans = 0;
rep... | #include <bits/stdc++.h>
// #define int long long
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repa(i, s, n) for (int i = s; i < (int)n; i++)
using namespace std;
using ll = long long;
typedef vector<int> vi;
signed main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> s(h);
int ans = 0;
rep... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]] | 1 | 179 |
/* Simplicity and Goodness */
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
void my... | /* Simplicity and Goodness */
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
void my... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 354]] | 1 | 401 |
#include <bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define INF (i64)1e18
#define MOD (i64)(1e9 + 7)
#define REP(i, n) for (i64 i = 0; i < n; i++)
#define RANGE(i, a, b) for (i64 i = a; i < b; i++)
#define EACH(v, e, p) for_each(v.begin(), v.end(), [](auto &e) p)
int main() {
int h, w, k;
cin ... | #include <bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define INF (i64)1e18
#define MOD (i64)(1e9 + 7)
#define REP(i, n) for (i64 i = 0; i < n; i++)
#define RANGE(i, a, b) for (i64 i = a; i < b; i++)
#define EACH(v, e, p) for_each(v.begin(), v.end(), [](auto &e) p)
int main() {
int h, w, k;
cin ... | [["-", 15, 339, 51, 69, 28, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 57, 15, 339, 51, 69, 341, 342, 0, 22], ["+", 0, 57, 15, 339, 51, 69, 341, 342, 0, 22]] | 1 | 263 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int m, n, k;
cin >> m >> n >> k;
vector<vector<char>> grid(m, vector<char>(n));
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
cin >> grid[i][j];
}
}
int ans = 0;
for (int markM = 0; markM < (1 << m); markM++) {
fo... | #include <bits/stdc++.h>
using namespace std;
int main() {
int m, n, k;
cin >> m >> n >> k;
vector<vector<char>> grid(m, vector<char>(n));
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
cin >> grid[i][j];
}
}
int ans = 0;
for (int markM = 0; markM < (1 << m); markM++) {
fo... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 237 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int h, w, k;
cin >> h >> w >> k;
char c[h][w];
for (ll i = 0; i < h; i++) {
for (ll j = 0; j < w; j++) {
cin >> c[i][j];
}
}
int res = 0;
for (int bit1 = 0; bit1 < (1 << h); bit1++) {
for (int bit2 = 0; bit... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int h, w, k;
cin >> h >> w >> k;
char c[h][w];
for (ll i = 0; i < h; i++) {
for (ll j = 0; j < w; j++) {
cin >> c[i][j];
}
}
int res = 0;
for (int bit1 = 0; bit1 < (1 << h); bit1++) {
for (int bit2 = 0; bit... | [["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]] | 1 | 369 |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// typedef int ll;
typedef long double ld;
//#define int ll
#define pb push_back
#define __bp __builtin_popcount
using vint = vector<int>;
using pii = pair<int, int>;
using pdd = pair<ld, ld>;
using vpii = vector<pii>;
#define F first
#define S second
... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// typedef int ll;
typedef long double ld;
//#define int ll
#define pb push_back
#define __bp __builtin_popcount
using vint = vector<int>;
using pii = pair<int, int>;
using pdd = pair<ld, ld>;
using vpii = vector<pii>;
#define F first
#define S second
... | [["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["-", 51, 16, 12, 91, 28, 23, 0, 16, 17, 98], ["+", 51, 16, 12, 91, 28, 23, 0, 16, 17, 106], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 354 |
#include <bits/stdc++.h>
using namespace std;
int h, w, k;
int ans = 0;
char a[10][10];
bool check(int s1, int s2) {
bool f[10][10] = {};
int i, j, tot = 0;
for (i = 0; i < h; i++)
if ((s1 >> i) & 1)
for (j = 1; j <= w; j++)
f[i + 1][j] = true;
for (i = 0; i < w; i++)
if ((s2 >> i) & ... | #include <bits/stdc++.h>
using namespace std;
int h, w, k;
int ans = 0;
char a[10][10];
bool check(int s1, int s2) {
bool f[10][10] = {};
int i, j, tot = 0;
for (i = 0; i < h; i++)
if ((s1 >> i) & 1)
for (j = 1; j <= w; j++)
f[i + 1][j] = true;
for (i = 0; i < w; i++)
if ((s2 >> i) & ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 22], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 12, 22]] | 1 | 326 |
#include <bits/stdc++.h>
using namespace std;
int n, m, k;
#define sc(x) scanf("%d", &(x))
string mp[6];
bool check(int x) {
int t = 0;
for (int i = 0; i < n; i++) {
if ((x >> i) & 1)
continue;
for (int j = 0; j < m; j++) {
if ((x >> (j + n)) & 1)
continue;
if (mp[i][j] == '#')
... | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
#define sc(x) scanf("%d", &(x))
string mp[6];
bool check(int x) {
int t = 0;
for (int i = 0; i < n; i++) {
if ((x >> i) & 1)
continue;
for (int j = 0; j < m; j++) {
if ((x >> (j + n)) & 1)
continue;
if (mp[i][j] == '#')
... | [["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["-", 51, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["-", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25]] | 1 | 216 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
using p = pair<int, int>;
using Graph = vector<vector<int>>;
const double PI = acos(-1);
int H, W, K;
int count(int h, int w, vector<vector<int>> arr) {
int sum = 0;
rep(i, H) {
rep(j, W) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
using p = pair<int, int>;
using Graph = vector<vector<int>>;
const double PI = acos(-1);
int H, W, K;
int count(int h, int w, vector<vector<int>> arr) {
int sum = 0;
rep(i, H) {
rep(j, W) ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]] | 1 | 272 |
//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <numeric>
#include <sstream>
#include <vector>
//---------------------... | //---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <numeric>
#include <sstream>
#include <vector>
//---------------------... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]] | 1 | 385 |
#include <bitset>
#include <cstdio>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int h, w, k, ans;
int maskR, maskC;
cin >> h >> w >> k;
char c[h][k];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> c[i][j];
}
}
ans = 0;
for (maskR = 0; maskR <... | #include <bitset>
#include <cstdio>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int h, w, k, ans;
int maskR, maskC;
cin >> h >> w >> k;
char c[h][w];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> c[i][j];
}
}
ans = 0;
for (maskR = 0; maskR <... | [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 238 |
#include <bits/stdc++.h>
#define pb push_back
#define Int int64_t
using namespace std;
const int MAXN = 7;
int main() {
char board[MAXN][MAXN];
Int n, m, K;
cin >> n >> m >> K;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> board[i][j];
}
}
Int ans = 0;
for (int mask = 0;... | #include <bits/stdc++.h>
#define pb push_back
#define Int int64_t
using namespace std;
const int MAXN = 7;
int main() {
char board[MAXN][MAXN];
Int n, m, K;
cin >> n >> m >> K;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> board[i][j];
}
}
Int ans = 0;
for (int mask = 0;... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 35]] | 1 | 209 |
#include <bits/stdc++.h>
typedef long long lint;
using namespace std;
lint gcd(lint x, lint y) {
if (x == 0) {
return y;
} else {
return gcd(y % x, x);
}
}
lint lcm(lint x, lint y) { return x / gcd(x, y) * y; }
lint C(lint n, lint k) {
if (n == k) {
return 1;
} else if (n < k) {
return 0;
... | #include <bits/stdc++.h>
typedef long long lint;
using namespace std;
lint gcd(lint x, lint y) {
if (x == 0) {
return y;
} else {
return gcd(y % x, x);
}
}
lint lcm(lint x, lint y) { return x / gcd(x, y) * y; }
lint C(lint n, lint k) {
if (n == k) {
return 1;
} else if (n < k) {
return 0;
... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 51, 16, 12, 23, 0, 16, 12, 23, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 5... | 1 | 534 |
#include <bits/stdc++.h>
using namespace std;
// using namespace arma;
#define ll long long
#define ld long double
// int ans(vector < vector<int > > xx)
// {
// return 0;
// }
int main() {
ll h, w, k;
cin >> h >> w >> k;
char arr[h][w];
ll bk = 0;
for (ll i = 0; i < h; i++) {
for (ll j = 0; j < w; j++... | #include <bits/stdc++.h>
using namespace std;
// using namespace arma;
#define ll long long
#define ld long double
// int ans(vector < vector<int > > xx)
// {
// return 0;
// }
int main() {
ll h, w, k;
cin >> h >> w >> k;
char arr[h][w];
ll bk = 0;
for (ll i = 0; i < h; i++) {
for (ll j = 0; j < w; j++... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["-", 51, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0,... | 1 | 260 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memse... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memse... | [["+", 51, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 17, 106], ["+", 0, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 334 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, x, res = 0;
cin >> n >> m >> x;
char a[n][m];
for (int i = 0; i < n; ++i)
for (int j = 0; j < m; ++j)
cin >> a[i][j];
for (int mask = 0; mask < (1 << (n + m)); ++mask) {
int count = 0;
for (int i = 0; i < n; ++i) {
f... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, x, res = 0;
cin >> n >> m >> x;
char a[n][m];
for (int i = 0; i < n; ++i)
for (int j = 0; j < m; ++j)
cin >> a[i][j];
for (int mask = 0; mask < (1 << (n + m)); ++mask) {
int count = 0;
for (int i = 0; i < n; ++i) {
f... | [["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 22], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 22]] | 1 | 202 |
#include <iostream>
#include <vector>
using namespace std;
using i64 = long long;
using f64 = double;
#define FOR(i, s, n) for (size_t i = (s); i < (size_t)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define BLACK '#'
template <typename T, typename U> inline bool chmax(T &a, U b) ... | #include <iostream>
#include <vector>
using namespace std;
using i64 = long long;
using f64 = double;
#define FOR(i, s, n) for (size_t i = (s); i < (size_t)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define BLACK '#'
template <typename T, typename U> inline bool chmax(T &a, U b) ... | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 310 |
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#ifdef OJ
#define debug(x) \
do { ... | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#ifdef OJ
#define debug(x) \
do { ... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 540 |
#include <bits/stdc++.h>
using namespace std;
int main() {
//----------変数置いたり代入したり----------
int H, W, K; // それぞれの変数は問で与えられた通り
cin >> H >> W >> K;
vector<vector<string>> clist(H, vector<string>(W));
// H×Wの配列に "." or "#"を代入
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
string c;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
//----------変数置いたり代入したり----------
int H, W, K; // それぞれの変数は問で与えられた通り
cin >> H >> W >> K;
vector<vector<char>> clist(H, vector<char>(W));
// H×Wの配列に "." or "#"を代入
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
char c;
c... | [["-", 0, 77, 39, 344, 3, 347, 0, 77, 39, 78], ["+", 0, 77, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 0, 56, 39, 344, 3, 347, 0, 77, 39, 78], ["+", 0, 56, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["-", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 7,... | 1 | 271 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
using ll = long long;
const int INF = 2147483647;
const ll MOD = 1000000007;
// const ll INF = 1000000000000000000LL;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> grid(w);
rep(i, h) {
string in;... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
using ll = long long;
const int INF = 2147483647;
const ll MOD = 1000000007;
// const ll INF = 1000000000000000000LL;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<string> grid(h);
rep(i, h) {
string in;... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 313 |
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef long long LL;
typedef long double Lf;
#define Rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rep(i, n) Rep(i, 0, n)
#define Ma(x, y) ((x) > (y) ? (x) : (y))
#define mi(x, y) ((x) < (y) ? (x) : (y))
... | #include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef long long LL;
typedef long double Lf;
#define Rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rep(i, n) Rep(i, 0, n)
#define Ma(x, y) ((x) > (y) ? (x) : (y))
#define mi(x, y) ((x) < (y) ? (x) : (y))
... | [["-", 28, 69, 28, 69, 28, 2, 3, 4, 0, 22], ["+", 28, 69, 28, 69, 28, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 46]] | 0 | 458 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int H, W, K;
scanf("%d%d%d", &H, &W, &K);
string m[H];
for (int i = 0; i < H; i++) {
cin >> m[i];
}
int count = 0;
for (int b = 0; b < 1 << (H + W); b++) {
int black = 0;
for (int i = 0; i < H * W; i++) {
if (b >> ... | #include <iostream>
#include <string>
using namespace std;
int main() {
int H, W, K;
scanf("%d%d%d", &H, &W, &K);
string m[H];
for (int i = 0; i < H; i++) {
cin >> m[i];
}
int count = 0;
for (int b = 0; b < 1 << (H + W); b++) {
int black = 0;
for (int i = 0; i < H * W; i++) {
if (b >> ... | [["-", 31, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["-", 31, 16, 12, 23, 0, 16, 12, 16, 12, 22], ["+", 31, 16, 12, 23, 0, 16, 12, 16, 12, 22], ["-", 31, 69, 28, 69, 341, 342, 0, 16, 12, 22], ["+", 31, 69, 28, 69, 341, 342, 0, 16, 12, 22], ["-", 51, 16, 31, 69, 341, 342, 0, 16, ... | 1 | 197 |
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include... | #pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include... | [["+", 0, 57, 15, 339, 51, 16, 31, 91, 17, 111]] | 1 | 1,678 |
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
typedef long long int ll;
#define FOR(i, a, b) for (int i = (a); i ... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
typedef long long int ll;
#define FOR(i, a, b) for (int i = (a); i ... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 8, 9, 0, 42, 0, 2, 3, 4, 0, 13]] | 1 | 424 |
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9 + 7;
typedef pair<ll, ll> pairs;
typedef vector<pairs> p;
struct edge {
ll to, cost;
};
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
} else {
ret... | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9 + 7;
typedef pair<ll, ll> pairs;
typedef vector<pairs> p;
struct edge {
ll to, cost;
};
ll gcd(ll a, ll b) {
if (b == 0) {
return a;
} else {
ret... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 533 |
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int, int> P;
typedef long long ll;
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<string> g(h);
rep(i, h) { cin >> g[i]; }
v... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int, int> P;
typedef long long ll;
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<string> g(h);
rep(i, h) { cin >> g[i]; }
... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 31, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 15, 339, 51, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 350 |
#include <cstdio>
using namespace std;
int n, m, cnt, p, o;
char a[10][10];
int main() {
scanf("%d%d%d", &n, &m, &p);
for (int i = 1; i <= n; ++i) {
scanf("%s", a[i] + 1);
}
for (int i = 0; i < (1 << n); ++i) {
for (int j = 0; j < (1 << m); ++j) {
bool b[10][10] = {false};
o = i;
for (... | #include <cstdio>
using namespace std;
int n, m, cnt, p, o;
char a[10][10];
int main() {
scanf("%d%d%d", &n, &m, &p);
for (int i = 1; i <= n; ++i) {
scanf("%s", a[i] + 1);
}
for (int i = 0; i < (1 << n); ++i) {
for (int j = 0; j < (1 << m); ++j) {
bool b[10][10] = {false};
o = i;
for (... | [["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 147]] | 1 | 333 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, need;
long long ans = 0;
cin >> h >> w >> need;
vector<string> s(w);
for (int i = 0; i < w; i++) {
cin >> s[i];
}
for (int i = 0; i < (1 << h); i++) {
for (int j = 0; j < (1 << w); j++) {
int bl = 0;
for (int k = 0; k... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, need;
long long ans = 0;
cin >> h >> w >> need;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
for (int i = 0; i < (1 << h); i++) {
for (int j = 0; j < (1 << w); j++) {
int bl = 0;
for (int k = 0; k... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 196 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a, b) for (int a = 0; a < b; a++)
#define Sort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#defin... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a, b) for (int a = 0; a < b; a++)
#define Sort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#defin... | [["+", 0, 11, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 31, 22], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 23, 0, 16, 31, 23, 0, 25]] | 1 | 3,467 |
#include <bits/stdc++.h>
using namespace std;
int h, w, k;
char mass[10][10];
int ans = 0;
void retsu(int n) {
if (n == w) {
int cnt = 0;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (mass[i][j] == '#')
cnt++;
}
}
if (cnt == k)
ans++;
retur... | #include <bits/stdc++.h>
using namespace std;
int h, w, k;
char mass[10][10];
int ans = 0;
void retsu(int n) {
if (n == w) {
int cnt = 0;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (mass[i][j] == '#')
cnt++;
}
}
if (cnt == k)
ans++;
retur... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 395 |
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
using namespace std;
using ll = unsigned long long;
using p = pair<int, int>;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<vector<int>> m(W, vector<int>(H));
const int black = 1;
rep(y, 0, H) {
string s;
... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
using namespace std;
using ll = unsigned long long;
using p = pair<int, int>;
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<vector<int>> m(H, vector<int>(W));
const int black = 1;
rep(y, 0, H) {
string s;
... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 0, 56, 49, 185, 54, 55, 0, 56, 39, 78], ["+", 0, 56, 49, 185, 54, 55, 0, 56, 39, 78]] | 1 | 254 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int mod = 1e9 + 7;
const int N = 2e5 + 100;
int a[N];
char s[10][10];
char ss[10][10];
int n, m, k;
bool check() {
int sum = 0;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
if (ss[i][j] == '#')
sum++;
if (sum == k)
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int mod = 1e9 + 7;
const int N = 2e5 + 100;
int a[N];
char s[10][10];
char ss[10][10];
int n, m, k;
bool check() {
int sum = 0;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
if (ss[i][j] == '#')
sum++;
if (sum == k)
... | [["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 8, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 8, 1, 0, 11, 31, 69, 341, 342, 0, 22]] | 1 | 411 |
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef long long ll;
#define MOD 1000000007;
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
... | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef long long ll;
#define MOD 1000000007;
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 13]] | 1 | 430 |
#include <bits/stdc++.h>
#define dalao main
#define ll long long
#define debug(x) \
{ cerr << #x << " = " << (x) << endl; }
using namespace std;
int m, n, k, black = 0, cha;
int s[10][10] = {0}, blackm[10] = {0}, blackn[10] = {0};
bool used[10][10] = {0};
... | #include <bits/stdc++.h>
#define dalao main
#define ll long long
#define debug(x) \
{ cerr << #x << " = " << (x) << endl; }
using namespace std;
int m, n, k, black = 0, cha;
int s[10][10] = {0}, blackm[10] = {0}, blackn[10] = {0};
bool used[10][10] = {0};
... | [["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13]] | 1 | 501 |
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<ll, ll>
#define pll pair<ll, ... | #ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<ll, ll>
#define pll pair<ll, ... | [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 22], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 22]] | 1 | 584 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int H, W, K;
vector<string> g0;
ll solve() {
int res = 0;
for (int s = 0; s < (1 << (H + W)); s++) {
set<int> rs, cs;
for (int i = 0; i < H; i++) {
if (s & (1 << i))
rs.... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int H, W, K;
vector<string> g0;
ll solve() {
int res = 0;
for (int s = 0; s < (1 << (H + W)); s++) {
set<int> rs, cs;
for (int i = 0; i < H; i++) {
if (s & (1 << i))
rs.... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 307 |
// Author: wlzhouzhuan
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define rint register int
#define rep(i, l, r) for (rint i = l; i <= r; i++)
#define per(i, l, r) for (rint i = l; i >= r; i--)
#define mset(s, _) mem... | // Author: wlzhouzhuan
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define rint register int
#define rep(i, l, r) for (rint i = l; i <= r; i++)
#define per(i, l, r) for (rint i = l; i >= r; i--)
#define mset(s, _) mem... | [["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]] | 1 | 620 |
#include <bits/stdc++.h>
using namespace std;
string S[10];
int main() {
int N, M, K;
cin >> N >> M >> K;
for (int i = 0; i < N; i++)
cin >> S[i];
int Ans = 0;
for (int S1 = 0; S1 < (1 << N); S1++)
for (int S2 = 0; S2 < (1 << M); S2++) {
int Cnt = 0;
for (int i = 0; i < N; i++)
if ... | #include <bits/stdc++.h>
using namespace std;
string S[10];
int main() {
int N, M, K;
cin >> N >> M >> K;
for (int i = 0; i < N; i++)
cin >> S[i];
int Ans = 0;
for (int S1 = 0; S1 < (1 << N); S1++)
for (int S2 = 0; S2 < (1 << M); S2++) {
int Cnt = 0;
for (int i = 0; i < N; i++)
if ... | [["-", 0, 7, 8, 57, 64, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 57, 64, 7, 15, 16, 12, 22]] | 1 | 191 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define MOD 998244353
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define MOD 998244353
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 354]] | 1 | 505 |
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[0]
cnt = 1
i = 1
while cnt < n-1:
cnt += 2
ans += a[i] * 2
i += 1
if cnt == n:
ans -= a[i]
print(ans)
| n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[0]
cnt = 1
i = 1
while cnt < n-1:
cnt += 2
ans += a[i] * 2
i += 1
if cnt == n:
ans -= a[i-1]
print(ans)
| [["+", 0, 1, 0, 677, 12, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]] | 5 | 81 |
// KNOW NOTHING!
#include <bits/stdc++.h>
#define ll long long int
#define F(i, j, k, in) for (int i = j; i < k; i += in)
#define DF(i, j, k, in) for (int i = j; i >= k; i -= in)
#define feach(it, l) for (auto it = l.begin(); it != l.end(); ++it)
#define fall(a) a.begin(), a.end()
#define sz(x) (int)x.size()
#define sz... | // KNOW NOTHING!
#include <bits/stdc++.h>
#define ll long long int
#define F(i, j, k, in) for (int i = j; i < k; i += in)
#define DF(i, j, k, in) for (int i = j; i >= k; i -= in)
#define feach(it, l) for (auto it = l.begin(); it != l.end(); ++it)
#define fall(a) a.begin(), a.end()
#define sz(x) (int)x.size()
#define sz... | [["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 435 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll N, i, ans;
ll A[222222];
cin >> N;
for (i = 0; i <= N - 1; i++)
cin >> A[i];
sort(A, A + N, greater<int>());
ans = A[0];
for (i = 0; i <= N - 3; i++)
ans += A[i / 2 + 2];
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll N, i, ans;
ll A[222222];
cin >> N;
for (i = 0; i <= N - 1; i++)
cin >> A[i];
sort(A, A + N, greater<int>());
ans = A[0];
for (i = 0; i <= N - 3; i++)
ans += A[i / 2 + 1];
cout << ans << endl;
} | [["-", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 111 |
n = gets.to_i
arr = gets.split.map(&:to_i).sort_by{|i| -i}
count = n - 2
sum = arr[0]
(2..n).each do |i|
if count == 0
puts sum
return
elsif count == 1
puts sum + arr[i]
return
end
count -= 2
sum += 2 * arr[i]
end
| n = gets.to_i
arr = gets.split.map(&:to_i).sort_by{|i| -i}
count = n - 2
sum = arr[0]
(1..n).each do |i|
if count == 0
puts sum
return
elsif count == 1
puts sum + arr[i]
return
end
count -= 2
sum += 2 * arr[i]
end
| [["-", 0, 493, 0, 652, 486, 739, 0, 475, 756, 612], ["+", 0, 493, 0, 652, 486, 739, 0, 475, 756, 612]] | 4 | 79 |
from sys import stdin
input = stdin.readline
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
res = a[0]
cnt = N - 2
cur = 1
while cnt:
if cnt == 1:
res += a[cur]
break
else:
res += a[cur] * 2
cnt -= 2
print(res) | from sys import stdin
input = stdin.readline
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
res = a[0]
cnt = N - 2
cur = 1
while cnt:
if cnt == 1:
res += a[cur]
break
else:
res += a[cur] * 2
cur += 1
cnt -= 2
print(res) | [["+", 75, 76, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 12, 612]] | 5 | 88 |
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
// cout << fixed << setprecision(8) << a << endl;
#define Fast_Input \
ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define pb push_back
#define mem(a, b) memset(a, b, s... | #include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
// cout << fixed << setprecision(8) << a << endl;
#define Fast_Input \
ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define pb push_back
#define mem(a, b) memset(a, b, s... | [["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 1 | 241 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 50;
const int inf = 0x3f3f3f3f;
const... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 50;
const int inf = 0x3f3f3f3f;
const... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 75, 76, 0, 9, 0, 57, 64, 9, 0, 45], ["-", 75, 76, 0, 9, 0, 57, 64, 9, 0, 46]] | 1 | 237 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.rbegin(), a.rend());
long long ans = 0;
for (int i = 0; i < n - 1; i++) {
ans += a[i / 2];
}
cout <... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.rbegin(), a.rend());
long long ans = 0;
for (int i = 0; i < n - 1; i++) {
ans += a[(i + 1) / 2];
}
... | [["+", 12, 69, 341, 342, 0, 16, 31, 23, 0, 24], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 12, 69, 341, 342, 0, 16, 31, 23, 0, 25]] | 1 | 119 |
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... | import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... | [["+", 0, 1, 0, 677, 12, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]] | 5 | 225 |
import math
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
comfortPoint = A[0]
for i in range(N)[1::]:
comfortPoint += A[math.ceil(i/2)]
print(comfortPoint)
| import math
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
comfortPoint = A[0]
for i in range(N-1)[1::]:
comfortPoint += A[math.ceil(i/2)]
print(comfortPoint)
| [["+", 12, 206, 51, 652, 3, 4, 0, 657, 17, 33], ["+", 12, 206, 51, 652, 3, 4, 0, 657, 12, 612]] | 5 | 71 |
N = int(input())
A = list(map(int, input().split())).sort()
len_A = len(A)
ans = 0
for i in range(1, len_A-1):
ans += A[len_A-1-int(i/2)]
print(ans) | N = int(input())
A = list(map(int, input().split()))
A.sort()
len_A = len(A)
ans = 0
for i in range(1, len_A):
ans += A[len_A-1-int(i/2)]
print(ans) | [["+", 0, 656, 0, 1, 0, 652, 63, 319, 500, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 69 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
int n;
cin >> n;
vector<ll> a(n);
rep(i, n) cin >> a[i];
sort(a.rbegin(), a.rend());
ll sum = a[0];
for (int i = 1; i < n / 2; i++) {
sum += 2 * a[... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main() {
int n;
cin >> n;
vector<ll> a(n);
rep(i, n) cin >> a[i];
sort(a.rbegin(), a.rend());
ll sum = a[0];
for (int i = 1; i < n / 2; i++) {
sum += 2 * a[... | [["-", 0, 11, 12, 69, 341, 342, 0, 16, 17, 72], ["-", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 144 |
n = int(input())
A = list(map(int, input().split()))
if n == 2:
print(max(A))
else:
A.sort(reverse=True)
ans = A[0]
for a in A[1:n//2]:
ans += 2 * a
if n % 2 == 1:
ans += A[-2]
print(ans) | n = int(input())
A = list(map(int, input().split()))
if n == 2:
print(max(A))
else:
A.sort(reverse=True)
ans = A[0]
for a in A[1:n//2]:
ans += 2 * a
if n % 2 == 1:
ans += A[n//2]
print(ans) | [["-", 0, 1, 0, 677, 12, 206, 206, 664, 17, 33], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 31, 22], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 17, 676]] | 5 | 88 |
N = int(input())
As = sorted(map(int, input().split()), reverse=True)
score = As[0]
counter = 0
index = 2
for i in range(2, N):
score += As[index]
if counter == 0:
counter += 1
else:
counter -= 1
index += 1
print(score)
| N = int(input())
As = sorted(map(int, input().split()), reverse=True)
score = As[0]
counter = 0
index = 1
for i in range(2, N):
score += As[index]
if counter == 0:
counter += 1
else:
counter -= 1
index += 1
print(score)
| [["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]] | 5 | 77 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.