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>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <=... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <=... | [["+", 12, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 25]] | 1 | 518 |
def main():
import sys
input=sys.stdin.readline
h,w,k=map(int,input().split())
S=[]
for _ in range(h):
s=list(map(int,list(input().rstrip())))
S.append(s)
ans=10**5
for i in range(2**(h-1)):
l=[0]
for j in range(h-1):
if i&1<<j:
l.a... | def main():
import sys
input=sys.stdin.readline
h,w,k=map(int,input().split())
S=[]
for _ in range(h):
s=list(map(int,list(input().rstrip())))
S.append(s)
ans=10**5
for i in range(2**(h-1)):
l=[0]
for j in range(h-1):
if i&1<<j:
l.a... | [["-", 75, 665, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 31, 22]] | 5 | 256 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
ll h, w, r, m, tmp, rans, ans, MIN = 1e9, ok;
string s[10];
vector<ll> v[1001], u;
int main(void) {
cin >> h >> w >> r;
for (int i = 0; i < h; i++)
cin >> s[i];
for (int i = 0; i < (1 << (h - 1)); i++) {
ok = 1;
ra... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
ll h, w, r, m, tmp, rans, ans, MIN = 1e9, ok;
string s[10];
vector<ll> v[1001], u;
int main(void) {
cin >> h >> w >> r;
for (int i = 0; i < h; i++)
cin >> s[i];
for (int i = 0; i < (1 << (h - 1)); i++) {
ok = 1;
ra... | [["-", 0, 7, 8, 9, 0, 57, 64, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117]] | 1 | 502 |
#include <algorithm>
#include <bitset>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> T;
#... | #include <algorithm>
#include <bitset>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> T;
#... | [["-", 8, 9, 0, 9, 0, 57, 64, 93, 0, 94], ["+", 8, 9, 0, 9, 0, 57, 64, 116, 0, 117]] | 1 | 978 |
#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int qs[12][N];
int dp[N];
char s[N];
int n, m, k;
int get(int i, int j, int k, int l) {
return qs[k][l] - qs[i - 1][l] - qs[k][j - 1] + qs[i - 1][j - 1];
}
int check(int bit, int st, int en) {
int last = 1;
for (int j = 1; j <= n; j++) {
if ((1... | #include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int qs[12][N];
int dp[N];
char s[N];
int n, m, k;
int get(int i, int j, int k, int l) {
return qs[k][l] - qs[i - 1][l] - qs[k][j - 1] + qs[i - 1][j - 1];
}
int check(int bit, int st, int en) {
int last = 1;
for (int j = 1; j <= n; j++) {
if ((1... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 489 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; ... | [["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35], ["+", 75, 76, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 75, 76, 0, 57, 64, 9, 0, 93, 0, 94]] | 1 | 518 |
// Sakhiya07 - Yagnik Sakhiya
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define mp make_pair
#define bp __builtin_popcountll
#define MOD 1000000007
const int N = 100005;
#defi... | // Sakhiya07 - Yagnik Sakhiya
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define mp make_pair
#define bp __builtin_popcountll
#define MOD 1000000007
const int N = 100005;
#defi... | [["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25]] | 1 | 502 |
#ifdef BODY
lint ppc(lint b) {
lint r = 0;
while (b)
r += b % 2, b /= 2;
return r;
}
int solve() {
lint h, w, k;
in(h, w, k);
vector<string> s(h);
in(s);
lint ans = linf;
rep(b, 1ll << (h - 1)) {
lint need = ppc(b);
vector<lint> p(h);
rep(h - 1) p[i + 1] = p[i] + ((b >> i) & 1ll);
... | #ifdef BODY
lint ppc(lint b) {
lint r = 0;
while (b)
r += b % 2, b /= 2;
return r;
}
int solve() {
lint h, w, k;
in(h, w, k);
vector<string> s(h);
in(s);
lint ans = linf;
rep(b, 1ll << (h - 1)) {
lint need = ppc(b);
vector<lint> p(h);
rep(h - 1) p[i + 1] = p[i] + ((b >> i) & 1ll);
... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13]] | 1 | 3,285 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
ll H, W, K;
cin >> H >> W >> K;
vector<string> S(H);
for (ll i = 0; i < H; i++) {
cin >> S[i];
}
ll ans = LLONG_MAX;
for (ll bit = 0; bit < (1 << (H - 1)); bit++) {
// sliceする場所
vector<ll> sl;
for (ll i =... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
ll H, W, K;
cin >> H >> W >> K;
vector<string> S(H);
for (ll i = 0; i < H; i++) {
cin >> S[i];
}
ll ans = LLONG_MAX;
for (ll bit = 0; bit < (1 << (H - 1)); bit++) {
// sliceする場所
vector<ll> sl;
for (ll i =... | [["-", 51, 4, 0, 74, 51, 2, 63, 118, 28, 22], ["+", 51, 4, 0, 74, 51, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25]] | 1 | 424 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
int uMax, vMax, k;
cin >> uMax >> vMax >> k;
vector<vector<bool>> isWhiteChoco(uMax);
for (int i = 0; i < uMax; i++) {
string s;
cin >> s;
isWhiteChoco[i] = vector<bool>(vMax);
for (int j =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
int uMax, vMax, k;
cin >> uMax >> vMax >> k;
vector<vector<bool>> isWhiteChoco(uMax);
for (int i = 0; i < uMax; i++) {
string s;
cin >> s;
isWhiteChoco[i] = vector<bool>(vMax);
for (int j =... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 538 |
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
Dy[8] = {-1, -1... | //#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
Dy[8] = {-1, -1... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18]] | 1 | 646 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll mod = 1000000007;
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<vector<ll>> c(h, vector<ll>(w));
vector<string> SS(h);
for (ll i = 0; i < h; i++)
cin >> SS[i];
for (ll i = 0; i < h; i++) {
fo... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll mod = 1000000007;
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<vector<ll>> c(h, vector<ll>(w));
vector<string> SS(h);
for (ll i = 0; i < h; i++)
cin >> SS[i];
for (ll i = 0; i < h; i++) {
fo... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]] | 1 | 557 |
/* ****revpro**** */
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define endl '\n'
#define pii pair<ll, ll>
#define vi vector<ll>
#define all(a) (a).begin(), (a).end()
#define F first
#d... | /* ****revpro**** */
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define endl '\n'
#define pii pair<ll, ll>
#define vi vector<ll>
#define all(a) (a).begin(), (a).end()
#define F first
#d... | [["-", 0, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 1,243 |
#include <bits/stdc++.h>
#define two(a) (1 << (a))
#define LINF (1ll << 61)
#define EPS (1e-14)
#define Lshift(a, b) (a << b)
#define Rshift(a, b) (a >> b)
#define rep(a, b) for (a = 0; a < b; a++)
#define xrep(a, b, c) for (a = b; a < c; a++)
#define INF (1 << 29)
#define swap(a, b) ((a ^= b), (b ^= a), (a ^= b))
#def... | #include <bits/stdc++.h>
#define two(a) (1 << (a))
#define LINF (1ll << 61)
#define EPS (1e-14)
#define Lshift(a, b) (a << b)
#define Rshift(a, b) (a >> b)
#define rep(a, b) for (a = 0; a < b; a++)
#define xrep(a, b, c) for (a = b; a < c; a++)
#define INF (1 << 29)
#define swap(a, b) ((a ^= b), (b ^= a), (a ^= b))
#def... | [["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 469 |
#include <bits/stdc++.h>
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL... | #include <bits/stdc++.h>
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL... | [["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["-", 0, 7, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 7, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 7, 8, 9, 0, 43, 49, 50, 51, 146], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 0, 35]] | 1 | 796 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define INF 1e9
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<string> S(H);
REP(i, ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define INF 1e9
int main() {
int H, W, K;
cin >> H >> W >> K;
vector<string> S(H);
REP(i, ... | [["-", 8, 9, 0, 9, 0, 57, 64, 93, 0, 94], ["+", 8, 9, 0, 9, 0, 57, 64, 116, 0, 117]] | 1 | 393 |
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001001001001001001;
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<string... | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001001001001001001;
int main() {
ll h, w, k;
cin >> h >> w >> k;
vector<string... | [["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 35]] | 1 | 389 |
#include <bits/stdc++.h>
using namespace std;
int grid[10][1000], n, m, k;
vector<int> get(int x, int y) {
vector<int> ans(m);
for (int c = 0; c < m; c++) {
for (int r = x; r < y; r++) {
ans[c] += grid[r][c];
}
}
return ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
... | #include <bits/stdc++.h>
using namespace std;
int grid[10][1000], n, m, k;
vector<int> get(int x, int y) {
vector<int> ans(m);
for (int c = 0; c < m; c++) {
for (int r = x; r < y; r++) {
ans[c] += grid[r][c];
}
}
return ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 542 |
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
const int I... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
const int I... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13]] | 1 | 311 |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif
void d_err() { cerr << endl; }
template <typename H, typename... T> void d_err(H h, T...... |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif
void d_err() { cerr << endl; }
template <typename H, typename... T> void d_err(H h, T...... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 1 | 408 |
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int H, W, K;
scanf("%d %d %d", &H, &W, &K);
int B[10][1000];
for (int i = 0; i < H; i++) {
char s[2000];
scanf("... | #include <algorithm>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int H, W, K;
scanf("%d %d %d", &H, &W, &K);
int B[10][1000];
for (int i = 0; i < H; i++) {
char s[2000];
scanf("... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 505 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 618 |
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (n); (i)++)
using namespace std;
using Graph = vector<vector<int>>;
using P = pair<long, long>;
long modpow(long a, long n, long mod) {
long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
re... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (n); (i)++)
using namespace std;
using Graph = vector<vector<int>>;
using P = pair<long, long>;
long modpow(long a, long n, long mod) {
long res = 1;
while (n > 0) {
if (n & 1)
res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
re... | [["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]] | 1 | 588 |
#include <bits/stdc++.h>
#define fi first
#define sd second
#define lson (nd << 1)
#define rson (nd << 11)
#define PB push_back
#define mid (l + r >> 1)
#define MP make_pair
#define SZ(x) (int)x.size()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
inline int read()... | #include <bits/stdc++.h>
#define fi first
#define sd second
#define lson (nd << 1)
#define rson (nd << 11)
#define PB push_back
#define mid (l + r >> 1)
#define MP make_pair
#define SZ(x) (int)x.size()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
inline int read()... | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 856 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define mkp make_pair
#define mkt make_tuple
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const l... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define mkp make_pair
#define mkt make_tuple
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const l... | [["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22]] | 1 | 552 |
import sys
import math
from collections import Counter
h, w, k = [int(s) for s in sys.stdin.readline().strip().split()]
s = [''] * h
for i in range(h):
s[i] = sys.stdin.readline().strip()
# h, w, k = 3, 5, 3
# s = [
# '11111',
# '11111',
# '11111'
# ]
ans = float('inf')
for i in range((h - 1) ** 2):... | import sys
import math
from collections import Counter
h, w, k = [int(s) for s in sys.stdin.readline().strip().split()]
s = [''] * h
for i in range(h):
s[i] = sys.stdin.readline().strip()
# h, w, k = 3, 5, 3
# s = [
# '11111',
# '11111',
# '11111'
# ]
# h, w, k = 10, 1000, 1
# s = ['11111111111111111... | [["-", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 31, 22], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["-", 12, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 578], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 578], ["+... | 5 | 299 |
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
// dp[i + 1][j] A[i]までで和がjにできるような場合の数
ll N, S, MOD = 998244353;
cin >> N >> S;
vector<ll> A(N);
rep(i, N) cin >> A[i];
vector<vector<ll>> dp(N + 1, vector<ll>(S + 1, 0));
rep(i,... | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
// dp[i + 1][j] A[i]までで和がjにできるような場合の数
ll N, S, MOD = 998244353;
cin >> N >> S;
vector<ll> A(N);
rep(i, N) cin >> A[i];
vector<vector<ll>> dp(N + 1, vector<ll>(3001, 0));
rep(i, ... | [["-", 51, 4, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 51, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 51, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 49, 50, 51, 4, 0, 2, 3, 4, 0, 13]] | 1 | 265 |
#include <bits/stdc++.h>
using namespace std;
// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> ... | #include <bits/stdc++.h>
using namespace std;
// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> ... | [["-", 8, 9, 0, 1, 0, 34, 31, 11, 12, 22], ["+", 8, 9, 0, 1, 0, 34, 31, 11, 12, 22], ["-", 8, 9, 0, 1, 0, 34, 12, 11, 12, 22], ["+", 8, 9, 0, 1, 0, 34, 12, 11, 12, 22]] | 1 | 1,209 |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int st[12];
int H, W, K;
string S[12];
int best;
int total[12][1024];
void horizontal(int ind, int nr) {
st[nr] = ind;
... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int st[12];
int H, W, K;
string S[12];
int best;
int total[12][1024];
void horizontal(int ind, int nr) {
st[nr] = ind;
... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 444 |
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
using namespace std;
using ll = long long;
#define double long double
using datas = pair<ll, ll>;
using ddatas ... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
using namespace std;
using ll = long long;
#define double long double
using datas = pair<ll, ll>;
using ddatas ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 1,112 |
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<strin... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<strin... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 492 |
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)
func scanString() string { sc.Scan(); return sc.Text() }
func scanRunes() []rune { return []rune(scanString()) }
func scanInt() int { a,_ := strconv.Atoi(scanString()); return a }
func scanInt... | package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)
func scanString() string { sc.Scan(); return sc.Text() }
func scanRunes() []rune { return []rune(scanString()) }
func scanInt() int { a,_ := strconv.Atoi(scanString()); return a }
func scanInt... | [["-", 0, 7, 0, 430, 10, 431, 31, 432, 0, 22], ["+", 0, 7, 0, 430, 10, 431, 31, 432, 0, 22], ["-", 64, 196, 0, 7, 0, 430, 15, 16, 31, 22], ["+", 64, 196, 0, 7, 0, 430, 15, 16, 31, 22], ["-", 64, 196, 0, 7, 0, 430, 26, 463, 0, 22], ["+", 64, 196, 0, 7, 0, 430, 26, 463, 0, 22], ["-", 8, 196, 0, 57, 15, 16, 31, 437, 71, 2... | 7 | 821 |
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n... | #pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n... | [["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22]] | 1 | 355 |
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 703 |
#include <stdio.h>
int h, w, k, f, e, dp, fla, ans;
char s[10][1005];
int d[10];
int c[10];
int ta[10];
int main() {
ans = 10000;
scanf("%d%d%d", &h, &w, &k);
for (int i = 0; i < h; i++) {
scanf(" %s", s[i]);
}
f = 1;
for (int i = 1; i < h; i++)
f *= 2;
for (int ee = 0; ee < f; ee++) {
e = ee;... | #include <stdio.h>
int h, w, k, f, e, dp, fla, ans;
char s[10][1005];
int d[10];
int c[10];
int ta[10];
int main() {
ans = 10000;
scanf("%d%d%d", &h, &w, &k);
for (int i = 0; i < h; i++) {
scanf(" %s", s[i]);
}
f = 1;
for (int i = 1; i < h; i++)
f *= 2;
for (int ee = 0; ee < f; ee++) {
e = ee;... | [["+", 15, 339, 51, 69, 341, 342, 0, 16, 17, 33], ["+", 15, 339, 51, 69, 341, 342, 0, 16, 12, 13]] | 1 | 485 |
#include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 655 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t H, W, K;
cin >> H >> W >> K;
vector<string> S(H);
for (string &s : S) {
cin >> s;
}
int64_t ans = INT_MAX;
const int64_t BIT_MAX = (1ULL << (H - 1));
for (int64_t i = 0; i < BIT_MAX; i++) {
// 1が立っている直後で切り発生
int64_t one_nu... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t H, W, K;
cin >> H >> W >> K;
vector<string> S(H);
for (string &s : S) {
cin >> s;
}
int64_t ans = INT_MAX;
const int64_t BIT_MAX = (1ULL << (H - 1));
for (int64_t i = 0; i < BIT_MAX; i++) {
// 1が立っている直後で切り発生
int64_t one_nu... | [["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46]] | 1 | 368 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
constexpr ll mod = 1000000007;
constexpr int inf = 1000000000;
constexpr ll linf = 1000000000000000000;
int main() {
int h, w, k;
cin >> h >> w >> k;
string str[h];
rep(i, h) cin >> str[i];
int c... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
constexpr ll mod = 1000000007;
constexpr int inf = 1000000000;
constexpr ll linf = 1000000000000000000;
int main() {
int h, w, k;
cin >> h >> w >> k;
string str[h];
rep(i, h) cin >> str[i];
int c... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 146], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 459 |
import sys
input=lambda: sys.stdin.readline().rstrip()
h,w,k=map(int,input().split())
S=[input() for _ in range(h)]
ans=float("inf")
import bisect
for i in range(2**(h-1)):
Cut=[]
cur=0
for ii in range(h-1):
if i&(1<<ii):
Cut.append(ii)
p=len(Cut)+1
Num=[0]*h
for ii in range(h):
Num[ii]=bisect... | import sys
input=lambda: sys.stdin.readline().rstrip()
h,w,k=map(int,input().split())
S=[input() for _ in range(h)]
ans=float("inf")
import bisect
for i in range(2**(h-1)):
Cut=[]
cur=0
for ii in range(h-1):
if i&(1<<ii):
Cut.append(ii)
p=len(Cut)+1
Num=[0]*h
for ii in range(h):
Num[ii]=bisect... | [["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 12, 146], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 12, 146]] | 5 | 276 |
#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[19][1009];
string s;
int x;
int tai[19];
int v[19];
int rez;
int ap[19];
int lin[19];
void verif() {
for (int i = 1; i <= n; i++)
ap[i] = 0;
int cr = x;
v[++x] = n;
for (int i = 1; i <= x; i++) {
for (int j = max(1, v[i - 1] + 1);... | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[19][1009];
string s;
int x;
int tai[19];
int v[19];
int rez;
int ap[19];
int lin[19];
void verif() {
for (int i = 1; i <= n; i++)
ap[i] = 0;
int cr = x;
v[++x] = n;
for (int i = 1; i <= x; i++) {
for (int j = max(1, v[i - 1] + 1);... | [["-", 8, 9, 0, 57, 64, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]] | 1 | 501 |
#include "bits/stdc++.h"
#define hhh cerr << "hhh" << endl
#define see(x) cerr << (#x) << '=' << (x) << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> pr;
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c != '-' && (c < '0' || c > '9'))
c = getchar();
if (c == '-')
... | #include "bits/stdc++.h"
#define hhh cerr << "hhh" << endl
#define see(x) cerr << (#x) << '=' << (x) << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> pr;
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c != '-' && (c < '0' || c > '9'))
c = getchar();
if (c == '-')
... | [["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25]] | 1 | 460 |
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;
template <class T> bool chmax(T &a, const T &b) {
return (a < b) ? (a = b, 1) : 0;
}
template <class T> bool chmin(T &a, const T &b) {
return (b < a) ? (a = b, 1) : 0;
}
int main() {
ci... | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;
template <class T> bool chmax(T &a, const T &b) {
return (a < b) ? (a = b, 1) : 0;
}
template <class T> bool chmin(T &a, const T &b) {
return (b < a) ? (a = b, 1) : 0;
}
int main() {
ci... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 431 |
#include <algorithm> // minmax, sort, swap
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio> // printf, scanf
#include <deque> // deque
#include <functional> // function<void(int)>
#include <iomanip> // cout<<setprecision(n)
#include <iostream> // cin, cout, cerr
#include <map> ... | #include <algorithm> // minmax, sort, swap
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio> // printf, scanf
#include <deque> // deque
#include <functional> // function<void(int)>
#include <iomanip> // cout<<setprecision(n)
#include <iostream> // cin, cout, cerr
#include <map> ... | [["-", 31, 69, 28, 2, 3, 4, 0, 16, 31, 22], ["+", 31, 69, 28, 2, 3, 4, 0, 16, 31, 22]] | 1 | 367 |
//#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | //#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 603 |
#include <bits/stdc++.h>
// ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
// clock_t start=clock();clock_t
// end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;
typedef pair<pii... | #include <bits/stdc++.h>
// ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
// clock_t start=clock();clock_t
// end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;
typedef pair<pii... | [["-", 31, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["+", 31, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["-", 51, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["+", 51, 16, 12, 69, 28, 69, 341, 342, 0, 22]] | 1 | 1,285 |
#pragma GCC optimize("O3", "unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#includ... | #pragma GCC optimize("O3", "unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#includ... | [["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25]] | 1 | 753 |
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#define MAXN 3005
const long long a = 998244353;
long long w[MAXN];
long long f[MAXN];
using namespace std;
long long n;
long long m;
long long sum = 0;
void dfs() {
memset(f, 0, sizeof(f));
f[0] = 1;
for (int i = 1; ... | #include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#define MAXN 3005
const long long a = 998244353;
long long w[MAXN];
long long f[MAXN];
using namespace std;
long long n;
long long m;
long long sum = 0;
void dfs() {
memset(f, 0, sizeof(f));
f[0] = 1;
for (int i = 1; ... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 47], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 8, 9, 0, 7, 15, 16, 12, 69, 28, 22], ["+", 0, 7, 15, 16, 12, 69, 341, 342, 0, 70], ["+", 0, 7, 15, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 7, 15, 16, 12, 69, 341, 342, 0, 73]] | 1 | 199 |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
#define ll long long
#define IO ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
#define ll long long
#define IO ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]] | 1 | 277 |
#pragma region head
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
template <class T> using vv = vector<vector<T>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (in... | #pragma region head
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
template <class T> using vv = vector<vector<T>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (in... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22]] | 1 | 618 |
#include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int main() {
ios::sync_with_stdio(false);
int n, s;
cin >> n >> s;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<long> d(s + 1);
static const int MOD = 998244353;
int res = 0;
f... | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int main() {
ios::sync_with_stdio(false);
int n, s;
cin >> n >> s;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<long> d(s + 1);
static const int MOD = 998244353;
int res = 0;
f... | [["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]] | 1 | 194 |
import java.io.*;
import java.util.*;
@SuppressWarnings("unused")
public class Main {
FastScanner in;
PrintWriter out;
final static int MOD = (int)1e9 + 7;
final static long INF = Long.MAX_VALUE / 2;
void solve() {
int N = in.nextInt(), S = in.nextInt();
int[] A = in.nextIntArray1Index(N);
long... | import java.io.*;
import java.util.*;
@SuppressWarnings("unused")
public class Main {
FastScanner in;
PrintWriter out;
final static int MOD = (int)1e9 + 7;
final static long INF = Long.MAX_VALUE / 2;
void solve() {
int MOD = 998244353;
int N = in.nextInt(), S = in.nextInt();
int[] A = in.nextInt... | [["+", 0, 195, 8, 196, 0, 503, 49, 200, 141, 22], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 0, 32], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 0, 35], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507]] | 3 | 1,619 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define rep(i, x, n) for (int i = x; i <= n; i++)
#define per(i, n, x... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define rep(i, x, n) for (int i = x; i <= n; i++)
#define per(i, n, x... | [["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 448 |
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
using namespace std;
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb(X) push_back(X)
#define x first
#define y second
#define all(x) (x).begin(), (x).end()
#def... | #pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
using namespace std;
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb(X) push_back(X)
#define x first
#define y second
#define all(x) (x).begin(), (x).end()
#def... | [["-", 51, 4, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 51, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 51, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 49, 50, 51, 4, 0, 2, 3, 4, 0, 13]] | 1 | 309 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 100;
const int maxc = 26;
const int mod = 998244353;
ll dp[3500];
ll a[3500];
int main() {
int n, s;
scanf("%d%d", &n, &s);
for (int i = 1; i <= n; i++)
scanf("%lld", &a[i]);
ll ans = 0;
for (int i = 1; i <= n; i++)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 100;
const int maxc = 26;
const int mod = 998244353;
ll dp[3500];
ll a[3500];
int main() {
int n, s;
scanf("%d%d", &n, &s);
for (int i = 1; i <= n; i++)
scanf("%lld", &a[i]);
ll ans = 0;
for (int i = 1; i <= n; i++)... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 47], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 64, 9, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 51, 22], ["+", 0, 57, 75,... | 1 | 256 |
#include <bits/stdc++.h>
#include <queue>
#include <vector>
using namespace std;
typedef long long int64;
const int P = 998244353;
const int MAXN = 3011;
int dp[MAXN];
int n, s, ans;
inline int add(int x, int y) {
x += y;
x -= x >= P ? P : 0;
return x;
}
inline int mul(int x, int y) { return 1ll * x * y % P; }... | #include <bits/stdc++.h>
#include <queue>
#include <vector>
using namespace std;
typedef long long int64;
const int P = 998244353;
const int MAXN = 3011;
int dp[MAXN];
int n, s, ans;
inline int add(int x, int y) {
x += y;
x -= x >= P ? P : 0;
return x;
}
inline int mul(int x, int y) { return 1ll * x * y % P; }... | [["-", 0, 7, 8, 9, 0, 7, 15, 91, 17, 92], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 209 |
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return... | #!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return... | [["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 612]] | 5 | 468 |
import sys
def input():
return sys.stdin.readline()[:-1]
n, s = map(int, input().split())
a = list(map(int, input().split()))
MOD = 998244353
dp = [0 for _ in range(s+1)]
dp[0] = 1
ans = 0
for i in range(n):
for j in range(s, a[i]-1, -1):
dp[j] += dp[j-a[i]]
dp[j] %= MOD
dp[a[i]] += i
dp[a[i]] %= MOD
ans += dp... | import sys
def input():
return sys.stdin.readline()[:-1]
n, s = map(int, input().split())
a = list(map(int, input().split()))
MOD = 998244353
dp = [0 for _ in range(3001)]
dp[0] = 1
ans = 0
for i in range(n):
for j in range(s, a[i]-1, -1):
dp[j] += dp[j-a[i]]
dp[j] %= MOD
dp[a[i]] += i
dp[a[i]] %= MOD
ans += d... | [["-", 0, 659, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612]] | 5 | 156 |
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll, ll>;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = ... | #pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll, ll>;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]] | 1 | 401 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MX = 100;
int h, w;
int grid[MX][MX];
int transitions[MX][MX];
bool used[MX][MX];
int dx[2] = {0, 1};
int dy[2] = {1, 0};
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
cin >> h >> w;
for (int i = 0; i < h; i++) {
for (int j ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MX = 100;
int h, w;
int grid[MX][MX];
int transitions[MX][MX];
bool used[MX][MX];
int dx[2] = {0, 1};
int dy[2] = {1, 0};
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
cin >> h >> w;
for (int i = 0; i < h; i++) {
for (int j ... | [["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]] | 1 | 451 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll dp[110][110];
int main() {
int h, w;
cin >> h >> w;
vector<vector<bool>> v(h, vector<bool>(w));
rep(i, h) rep(j, w) {
char c;
cin >> c;
if (c == '#')
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll dp[110][110];
int main() {
int h, w;
cin >> h >> w;
vector<vector<bool>> v(h, vector<bool>(w));
rep(i, h) rep(j, w) {
char c;
cin >> c;
if (c == '#')
... | [["+", 0, 57, 15, 339, 51, 16, 31, 91, 17, 111], ["-", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111]] | 1 | 309 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define For(i, a, b) for (int i = a; i <= b; i++)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define MOD (ll)(1e9 + 7)
#define INF (9e18)
#define EPS (1e-6)
#define debug... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define For(i, a, b) for (int i = a; i <= b; i++)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define MOD (ll)(1e9 + 7)
#define INF (9e18)
#define EPS (1e-6)
#define debug... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 9,... | 1 | 622 |
// by Balloons
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i, a, b) for (int(i) = (a); (i) <= (b); (i)++)
using namespace std;
typedef long long LL;
const int inf = 1e9;
int n, m;
char s[105][105];
int dp[105][105]... | // by Balloons
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i, a, b) for (int(i) = (a); (i) <= (b); (i)++)
using namespace std;
typedef long long LL;
const int inf = 1e9;
int n, m;
char s[105][105];
int dp[105][105]... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 407 |
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
#define all(x) (x).begin(), (x).end()
const int MAX = 105;
char inp[MAX][MAX];
int H, W;
bool empty(int x, int y) {
if (inp[x][y] == '#')
return false;
return true;
}
bool okay(int x, int y) { return x >= 0 && x ... | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
#define all(x) (x).begin(), (x).end()
const int MAX = 105;
char inp[MAX][MAX];
int H, W;
bool empty(int x, int y) {
if (inp[x][y] == '#')
return false;
return true;
}
bool okay(int x, int y) { return x >= 0 && x ... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22]] | 1 | 632 |
#include <bits/stdc++.h>
using namespace std;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;
// forループ
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
// 定数宣言
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
// グラフ表現
using Graph = vector<vector<int>>;
// グラフの辺表現
using Edge = map<pair<in... | #include <bits/stdc++.h>
using namespace std;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;
// forループ
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
// 定数宣言
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
// グラフ表現
using Graph = vector<vector<int>>;
// グラフの辺表現
using Edge = map<pair<in... | [["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 590 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
string s[h][w];
int dp[h][w];
string tmp;
for (int i = 0; i < h; i++) {
cin >> tmp;
for (int j = 0; j < w; j++) {
s[i][j] = tmp[j];
}
}
int tmpx, tmpy;
if (s[0][0] == "#") {
dp[0][0] = 1;
} e... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
string s[h][w];
int dp[h][w];
string tmp;
for (int i = 0; i < h; i++) {
cin >> tmp;
for (int j = 0; j < w; j++) {
s[i][j] = tmp[j];
}
}
int tmpx, tmpy;
if (s[0][0] == "#") {
dp[0][0] = 1;
} e... | [["-", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 507 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define MOD 1000000007
#define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++)
#define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++)
#define repi(i, n) for (ll(i) = 0LL; (i) <= (l... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define MOD 1000000007
#define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++)
#define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++)
#define repi(i, n) for (ll(i) = 0LL; (i) <= (l... | [["-", 0, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 3, 4, 0, 16, 31, 69, 341, 342, 0, 22], ["+", 3, 4, 0, 16, 31, 69, 341, 342, 0, 22], ["-", 31, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 31, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 15, 16, 31, 16, 31, 69, 341, 342,... | 1 | 666 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repo(i, n) for (int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repo(i, n) for (int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define... | [["-", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125]] | 1 | 511 |
#include <stdio.h>
#define INF 1001001001
int min(int x, int y) { return x < y ? x : y; }
int main() {
int h, w, dp[100][100];
char s[101][101];
scanf("%d%d", &h, &w);
for (int i = 0; i < h; i++) {
scanf("%s", s[i]);
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
dp[i][j] = INF;... | #include <stdio.h>
#define INF 1001001001
int min(int x, int y) { return x < y ? x : y; }
int main() {
int h, w, dp[100][100];
char s[101][101];
scanf("%d%d", &h, &w);
for (int i = 0; i < h; i++) {
scanf("%s", s[i]);
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
dp[i][j] = INF;... | [["-", 0, 41, 15, 16, 31, 16, 12, 103, 0, 125], ["+", 0, 41, 15, 16, 31, 16, 12, 103, 0, 125], ["-", 0, 41, 15, 16, 12, 16, 12, 103, 0, 125], ["+", 0, 41, 15, 16, 12, 16, 12, 103, 0, 125]] | 0 | 360 |
#include <bits/stdc++.h>
#define maxn 1000
using namespace std;
char tu[maxn][maxn];
int dp[maxn][maxn];
int main() {
int r, c;
cin >> r >> c;
getchar();
for (int i = 1; i <= r; i++) {
for (int j = 1; j <= c; j++) {
scanf("%c", &tu[i][j]);
}
getchar();
}
if (tu[1][1] == '#') {
dp[1][1... | #include <bits/stdc++.h>
#define maxn 1000
using namespace std;
char tu[maxn][maxn];
int dp[maxn][maxn];
int main() {
int r, c;
cin >> r >> c;
getchar();
for (int i = 1; i <= r; i++) {
for (int j = 1; j <= c; j++) {
scanf("%c", &tu[i][j]);
}
getchar();
}
if (tu[1][1] == '#') {
dp[1][1... | [["-", 12, 23, 0, 16, 31, 69, 28, 69, 28, 22], ["+", 12, 23, 0, 16, 31, 69, 28, 69, 28, 22]] | 1 | 457 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T> inline void chkmax(T &x, T y)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T> inline void chkmax(T &x, T y)... | [["+", 12, 16, 12, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 12, 23, 0, 16, 12, 16, 12, 22]] | 1 | 438 |
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
int main() {
int n, s;
cin >> n >> s;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
ll ret = 0;
vector<ll> dp(s + 1);
for (int i = 0; i < n; i++) {
if (a[i] > s)
contin... | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
int main() {
int n, s;
cin >> n >> s;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
ll ret = 0;
vector<ll> dp(s + 1);
for (int i = 0; i < n; i++) {
if (a[i] <= s) {
dp[... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["-", 0, 7, 8, 9, 0, 57, 64, 116, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 7, 8, 9, 0, 46]] | 1 | 214 |
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
#define all(x) x.begin(), x.end()
#define trav(i, a) for (auto &i : a)
inline int in() {
int x;
scanf("%lld", &x);
return x;
}
int n, m;
int... | #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
#define all(x) x.begin(), x.end()
#define trav(i, a) for (auto &i : a)
inline int in() {
int x;
scanf("%lld", &x);
return x;
}
int n, m;
int... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 420 |
#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DE... | #include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DE... | [["-", 12, 69, 28, 69, 341, 342, 0, 16, 31, 22], ["+", 12, 69, 28, 69, 341, 342, 0, 16, 31, 22], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 31, 22], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 31, 22]] | 1 | 428 |
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <util... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <util... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 1,350 |
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int(i) = 0; i < (n); i++)
#define rrep(i, n) for (int(i) = 1; i <= (n); i++)
#define REP(i, m, n) for (int(i) = (m); (i) < (n); (i)++)
#define MOD 1000000007... | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int(i) = 0; i < (n); i++)
#define rrep(i, n) for (int(i) = 1; i <= (n); i++)
#define REP(i, m, n) for (int(i) = (m); (i) < (n); (i)++)
#define MOD 1000000007... | [["+", 12, 69, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 12, 69, 28, 69, 341, 342, 0, 16, 12, 13], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 538 |
#include <bits/stdc++.h>
using namespace std;
static const int INF = 1e9 + 7;
int dx[] = {1, 0};
int dy[] = {0, 1};
int main() {
int H, W;
cin >> H >> W;
char s[100 + 10][100 + 10];
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> s[i][j];
}
}
vector<vector<int>> dp(H + 1... | #include <bits/stdc++.h>
using namespace std;
static const int INF = 1e9 + 7;
int dx[] = {1, 0};
int dy[] = {0, 1};
int main() {
int H, W;
cin >> H >> W;
char s[100 + 10][100 + 10];
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> s[i][j];
}
}
vector<vector<int>> dp(H + 1... | [["-", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125]] | 1 | 350 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<vector<char>> vec(H + 1, vector<char>(W + 1));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> vec[i + 1][j + 1];
}
}
vector<vector<int>> dp(H + 1, vector<int>(W + 1, 0));
if (vec[1... | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<vector<char>> vec(H + 1, vector<char>(W + 1));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> vec[i + 1][j + 1];
}
}
vector<vector<int>> dp(H + 1, vector<int>(W + 1, 0));
if (vec[1... | [["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13]] | 1 | 481 |
#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef long long ll;
typedef pair<ll, int> P;
typedef set<int> S;
t... | #include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef long long ll;
typedef pair<ll, int> P;
typedef set<int> S;
t... | [["+", 49, 53, 54, 55, 0, 56, 49, 352, 0, 67]] | 1 | 415 |
#include <bits/stdc++.h>
#include <cctype>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) (v).begin(), (v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int, int>
// ランレングス圧縮(Run Length Encoding)
vector<pair... | #include <bits/stdc++.h>
#include <cctype>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) (v).begin(), (v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int, int>
// ランレングス圧縮(Run Length Encoding)
vector<pair... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 528 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);
const ld EPS = 0.0000000001;
int h, w;
vector<vector<char>> g;
int tmp = 1e+7;
// void dfs(int x, int y, int cnt=0){
// if(h<=x || w<=y || tmp<=cnt) return;
// if(g[x... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);
const ld EPS = 0.0000000001;
int h, w;
vector<vector<char>> g;
int tmp = 1e+7;
// void dfs(int x, int y, int cnt=0){
// if(h<=x || w<=y || tmp<=cnt) return;
// if(g[x... | [["-", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125]] | 1 | 367 |
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define start \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.... | #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define start \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.... | [["-", 12, 23, 0, 16, 31, 16, 12, 103, 0, 125], ["+", 12, 23, 0, 16, 31, 16, 12, 103, 0, 125], ["-", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125], ["+", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125]] | 1 | 325 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
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... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
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... | [["-", 31, 69, 28, 69, 341, 342, 0, 16, 17, 33], ["-", 31, 69, 28, 69, 341, 342, 0, 16, 12, 13], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 12, 13]] | 1 | 585 |
#include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main() {
int h, w;
cin >> h >> w;
int dp[h][w];
vector<vector<char>> v(h, vector<char>(w, 0));
r(i, h) {
r(j, w) {
cin >> v[i][j];
dp[i][j] = 1000;
}
}
if (v[0][0] == '#... | #include <bits/stdc++.h>
#define r(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main() {
int h, w;
cin >> h >> w;
int dp[h][w];
vector<vector<char>> v(h, vector<char>(w, 0));
r(i, h) {
r(j, w) {
cin >> v[i][j];
dp[i][j] = 1000;
}
}
if (v[0][0] == '#... | [["-", 31, 69, 28, 69, 341, 342, 0, 16, 17, 72], ["-", 31, 69, 28, 69, 341, 342, 0, 16, 12, 13], ["+", 31, 69, 28, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 69, 28, 69, 341, 342, 0, 16, 12, 13]] | 1 | 583 |
#include <bits/stdc++.h>
using namespace std;
int N, M, best[110][110];
string s[110];
int main() {
cin >> N >> M;
for (int i = 0; i < N; ++i) {
cin >> s[i];
}
if (s[0][0] == '#')
best[0][0] = 1;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < M; ++j) {
if (i + j == 0)
continue;
... | #include <bits/stdc++.h>
using namespace std;
int N, M, best[110][110];
string s[110];
int main() {
cin >> N >> M;
for (int i = 0; i < N; ++i) {
cin >> s[i];
}
if (s[0][0] == '#')
best[0][0] = 1;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < M; ++j) {
if (i + j == 0)
continue;
... | [["-", 51, 16, 12, 16, 12, 69, 28, 69, 28, 22], ["+", 51, 16, 12, 16, 12, 69, 28, 69, 28, 22]] | 1 | 285 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define m0(x) memset(x, 0, sizeof(x))
int dx4[4] = {1, 0, -1, 0}, ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define m0(x) memset(x, 0, sizeof(x))
int dx4[4] = {1, 0, -1, 0}, ... | [["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]] | 1 | 608 |
#include <bits/stdc++.h>
using namespace std;
string a[100];
int dp[100][100], h, w;
const int inf = 0x3f3f3f3f;
int main() {
cin >> h >> w;
for (int i = 0; i < h; i++)
cin >> a[i];
dp[1][1] = (a[0][0] == '#');
for (int i = 0; i < h; i++)
for (int j = 0; j < w; j++)
if (i + j != 0) {
dp[i]... | #include <bits/stdc++.h>
using namespace std;
string a[100];
int dp[100][100], h, w;
const int inf = 0x3f3f3f3f;
int main() {
cin >> h >> w;
for (int i = 0; i < h; i++)
cin >> a[i];
dp[0][0] = (a[0][0] == '#');
for (int i = 0; i < h; i++)
for (int j = 0; j < w; j++)
if (i + j != 0) {
dp[i]... | [["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 13], ["+", 0, 11, 31, 69, 28, 69, 341, 342, 0, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13]] | 1 | 279 |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5;
int dp[N][N], r, c;
char mp[N][N];
map<char, int> ch;
int main() {
ch['#'] = 1, ch['.'] = 0;
cin >> r >> c;
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
cin >> mp[i][j];
memset(dp, 0x3f, sizeof dp);
dp[1][1] = ch[mp[1]... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5;
int dp[N][N], r, c;
char mp[N][N];
map<char, int> ch;
int main() {
ch['#'] = 1, ch['.'] = 0;
cin >> r >> c;
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
cin >> mp[i][j];
memset(dp, 0x3f, sizeof dp);
dp[1][1] = ch[mp[1]... | [["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 1 | 271 |
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define DEBUG
#define fi first
#define se second
#define ... | #include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define DEBUG
#define fi first
#define se second
#define ... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 542 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
char a[h][w];
char x;
for (int i = 0; i < h; i++)
for (int j = 0; j < w; j++)
cin >> a[i][j];
int dp[h][w]{0};
if (a[0][0] == '#')
dp[0][0] = 1;
for (int j = 1; j < w; j++) {
if (a[0][j] == '#' && ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
char a[h][w];
char x;
for (int i = 0; i < h; i++)
for (int j = 0; j < w; j++)
cin >> a[i][j];
int dp[h][w]{0};
if (a[0][0] == '#')
dp[0][0] = 1;
for (int j = 1; j < w; j++) {
if (a[0][j] == '#' && ... | [["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]] | 1 | 437 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const vector<int> dx = {1, 0};
const vector<int> dy = {0, 1};
const ll INF = 1LL << 60;
int main() {
std::ios::sync_with_stdio(false);
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const vector<int> dx = {1, 0};
const vector<int> dy = {0, 1};
const ll INF = 1LL << 60;
int main() {
std::ios::sync_with_stdio(false);
... | [["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 51, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 51, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 346 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxs = 1e6 + 5;
const ll lmaxs = 20;
ll mod = 1e9 + 7;
ll oo = 1e15;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxs = 1e6 + 5;
const ll lmaxs = 20;
ll mod = 1e9 + 7;
ll oo = 1e15;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(... | [["-", 0, 30, 0, 14, 8, 9, 0, 171, 0, 184], ["+", 0, 30, 0, 14, 8, 9, 0, 171, 0, 172]] | 1 | 531 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
int dp[1005][1005];
string a[1005];
int solve(int i, int j) {
if (i == n - 1 && j == n - 1)
return a[i][j] == '#';
int &ret = dp[i][j];
if (~ret)
return ret;
ret = n * m * 2;
if (j + 1 < m)
ret = min(ret, solve(i, j + 1)... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, m;
int dp[1005][1005];
string a[1005];
int solve(int i, int j) {
if (i == n - 1 && j == m - 1)
return a[i][j] == '#';
int &ret = dp[i][j];
if (~ret)
return ret;
ret = n * m * 2;
if (j + 1 < m)
ret = min(ret, solve(i, j + 1)... | [["-", 15, 339, 51, 16, 12, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 31, 22]] | 1 | 285 |
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 105;
const int INF = 0x3f3f3f3f;
string ss[maxn];
int minn[maxn][maxn];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++)
... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 105;
const int INF = 0x3f3f3f3f;
string ss[maxn];
int minn[maxn][maxn];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++)
... | [["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 22], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 12, 22]] | 1 | 321 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n; i++)
#define rep2(i, n) for (int i = 0; i <= n; i++)
#define repr(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define P pair<long long, l... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n; i++)
#define rep2(i, n) for (int i = 0; i <= n; i++)
#define repr(i, a, n) for (int i = a; i < n; i++)
#define all(a) a.begin(), a.end()
#define P pair<long long, l... | [["+", 75, 76, 0, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]] | 1 | 720 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
int H, W;
string S[101];
int dp[101][101];
int main() {
cin >> H >> W;
for (ll y = 0; y < H; y++)
cin >> S[y];
for (ll y = 0; y < H; y++) {
for (ll x = 0; y < W; y++)
dp[y][x] = INF;
}
dp[0][0] = 0;
if (S... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
int H, W;
string S[101];
int dp[101][101];
int main() {
cin >> H >> W;
for (ll y = 0; y < H; y++)
cin >> S[y];
for (ll y = 0; y < 101; y++) {
for (ll x = 0; x < 101; x++)
dp[y][x] = INF;
}
dp[0][0] = 0;
i... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 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, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 7, 26, 27... | 1 | 401 |
#include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
template <typename T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T> inline bool chmax(T &a, T b) {
if (a < b) {
... | #include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
template <typename T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T> inline bool chmax(T &a, T b) {
if (a < b) {
... | [["-", 31, 69, 28, 69, 341, 342, 0, 16, 31, 22], ["-", 31, 69, 28, 69, 341, 342, 0, 16, 17, 33], ["-", 31, 69, 28, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 31, 69, 28, 69, 341, 342, 0, 13], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 31, 22], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 51, 16, 31, 69, 341, 342,... | 1 | 406 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int h, w;
cin >> h >> w;
string s[h];
for (int i = 0; i < h; ++i)
cin >> s[i];
int dp[h][w];
fill(dp[0], dp[0] + h * w, 0x7fffffff);
dp[0][0] = (s[0][0] == '#');
for (int i = 0; i < h; ++i) {
for ... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int h, w;
cin >> h >> w;
string s[h];
for (int i = 0; i < h; ++i)
cin >> s[i];
int dp[h][w];
fill(dp[0], dp[0] + h * w, 0x7fffffff);
dp[0][0] = (s[0][0] == '#');
for (int i = 0; i < h; ++i) {
for ... | [["-", 12, 23, 0, 16, 31, 16, 12, 103, 0, 125], ["+", 12, 23, 0, 16, 31, 16, 12, 103, 0, 125], ["-", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125], ["+", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125]] | 1 | 282 |
#include <bits/stdc++.h>
#define ll long long
#define fornum(A, B, C) for (A = B; A < C; ++A)
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
/////////////////////////////////////////////////////
ll H, W;
char S[111][111];
ll dp[111][111];
ll i, j, k;
int main() {
scanf("%lld%lld", &H, &W... | #include <bits/stdc++.h>
#define ll long long
#define fornum(A, B, C) for (A = B; A < C; ++A)
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
/////////////////////////////////////////////////////
ll H, W;
char S[111][111];
ll dp[111][111];
ll i, j, k;
int main() {
scanf("%lld%lld", &H, &W... | [["-", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125], ["-", 12, 23, 0, 16, 31, 16, 12, 103, 0, 125], ["+", 12, 23, 0, 16, 31, 16, 12, 103, 0, 125], ["-", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125], ["+", 12, 23, 0, 16, 12, 16, 12, 103, 0, 125]] | 1 | 334 |
#include <stdio.h>
int main() {
int H, W;
int i, j;
int p, q;
int ans = 0;
char c;
int a[1000][100];
int b[1000][100];
scanf("%d %d", &H, &W);
getchar();
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
scanf("%c", &c);
if (c == '#')
a[i][j] = 1;
else
a[i][j... | #include <stdio.h>
int main() {
int H, W;
int i, j;
int p, q;
int ans = 0;
char c;
int a[1000][100];
int b[1000][100];
scanf("%d %d", &H, &W);
getchar();
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
scanf("%c", &c);
if (c == '#')
a[i][j] = 1;
else
a[i][j... | [["-", 0, 2, 3, 4, 0, 69, 28, 69, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 28, 69, 28, 22]] | 1 | 420 |
//人正是因为度过了一段阴暗岁月,才会更渴求黎明的曙光
//青春不能回头。所以青春也没有终点。
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <memory.h>
#include <queue>
#include <set>
#include <sstream... | //人正是因为度过了一段阴暗岁月,才会更渴求黎明的曙光
//青春不能回头。所以青春也没有终点。
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <memory.h>
#include <queue>
#include <set>
#include <sstream... | [["-", 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 | 382 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.