Search is not available for this dataset
name stringlengths 2 88 | description stringlengths 31 8.62k | public_tests dict | private_tests dict | solution_type stringclasses 2
values | programming_language stringclasses 5
values | solution stringlengths 1 983k |
|---|---|---|---|---|---|---|
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
int bsr(int x) { return 31 - __builtin_clz(x); }
template <class E>
using Graph = vector<vector<E>>;
template <class D, D INF>
struct BidirectedCut {
D... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
int x[100], y[100], c[100];
int r[100], tmp1, tmp2;
int cost, total;
int i, j;
while (1) {
cin >> n >> m;
if (!n && !m) break;
total = 0;
for (i = 0; i < m; i++) {
cin >> x[i] >> y[i] >> c[i];
total += c[i];
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_type =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge e = ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
typedef long long ll;
struct info{ll from, to, cost;};
struct edge{ll to, cap, rev;};
const int MAX = 105;
vector<edge> G[MAX], cG[MAX];
bool used[MAX];
void add_edge(ll from, ll to, ll c... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
using namespace std;
int mat[600][600];
int Mincut(int n) {
int res = 1 << 29, node[600], dist[600];
bool visit[600];
int i, prev, maxj, j, k;
for (i = 0; i < n; i++) node[i] = i;
while (n > 1) {
maxj = 1;
for (i = 1; i < n; i++) {
dist[node[i]] = ma... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | while True:
n,m=map(int,input().split())
if (n|m)==0: break
d={}
for i in range(m):
u,v,w=map(int,input().split())
if u>v: u,v=v,u
d[(u,v)]=d.get((u,v),0)+w
print(min(d.values())) |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
struct FordFulkerson {
struct Edge {
int to, cap, rev;
Edge(int to = 0, int cap = 0, int rev = 0) : to(to), cap(cap), rev(rev) {}
};
int V;
vector<vector<Edge> > G;
vector<boo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0;
vector<pair<long long, long long> > edge[n];
for (int i = 0; i < int(m); ++i) {
long long x, y, c;
cin >> x >... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int V, E;
bool used[101];
int cnt;
struct Edge {
int to, cost;
Edge() {}
Edge(int _t, int _c) : to(_t), cost(_c) {}
};
vector<Edge> G[101];
void check(int x) {
used[x] = true;
cnt++;
for (int i = 0; i < G[x].size(); i++) {
int to = G[x][i].to;
if (used[t... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | UNKNOWN | ### subroutines
def connected?(n, nbrs, edges)
used = n.times.map{false}
used[0] = true
q = [0]
while ! q.empty?
u = q.shift
for v in nbrs[u]
if ! edges[u][v].nil? && ! used[v]
used[v] = true
q << v
end
end
end
for usd in used
return false if ! usd
end
tru... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long n, m;
long long mini;
long long g[100];
long long f[100];
pair<long long, pair<long long, long long> > e[100];
long long I, J;
int main() {
long long sum, cnt;
while (cin >> n >> m && n && m) {
sum = 0;
for (int i = 0; i < m; i++) {
cin >> e[i].s... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long MAX = LONG_LONG_MAX;
long long V, E;
bool used[101];
long long cnt;
struct Edge {
long long to, cost;
Edge() {}
Edge(long long _t, long long _c) : to(_t), cost(_c) {}
};
vector<Edge> G[101];
void check(long long x) {
used[x] = true;
cnt++;
for (l... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
bool found;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()) {
v.assign(a, vector<T>(b, t));
}
template <class F, class T>
void convert(const F &f, T &t) {
stringstream ss;
ss << f;
ss >> t;
}
static const int INF = 1 << 24;
template <class ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <iostream>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <numeric>
#include <bitset>
#include <stack>
using namespace std;
typedef struct
{
int to... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long n, m;
long long mini;
long long g[100];
long long f[100];
pair<long long, pair<long long, long long> > e[100];
long long I, J;
int main() {
long long sum, cnt;
while (cin >> n >> m && n && m) {
sum = 0;
for (int i = 0; i < m; i++) {
cin >> e[i].s... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
using namespace std;
int n,m;
int x[100],y[100],c[100];
bool use[100];
int par[100],rank[100];
int find(int x){
if(par[x] == x)return x;
else return par[x] = find(par[x]);
}
bool union2(void){
int i;
int a,b,c;
for(i=0;i<n;i++){
par[i] = i;
rank[i] = 0;
}
c = n;
for(i=... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
int from;
int to;
int w;
int wy;
int next;
} edge[2 * 20010];
int ne, head[1010];
int n, m, ans, ansf;
void add(int from, int to, int w) {
edge[ne].from = from;
edge[ne].to = to;
edge[ne].w = w;
edge[ne].wy = w;
edge[ne].next = head[from];
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
return os << '(' << p.first << ',' << p.second << ')';
}
template <typename Tuple>
void print_tuple(ostream&, const Tuple&) {}
template <typename Car, typename... Cdr, typename T... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | while True:
n,m=map(int,input().split())
if (n|m)==0: break
d={}
for i in range(m):
u,v,w=map(int,input().split())
if u>v: u,v=v,u
#d[(u,v)]=d.get((u,v),0)+w
#print(min(d.values())) |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 201;
const long long MAXV = 0x3F3F3F3F3F3F3F3FLL;
int n, m, v[MAXN];
long long mat[MAXN][MAXN], dis[MAXN];
bool vis[MAXN], dij[MAXN][MAXN];
long long Stoer_Wagner(int n) {
long long res = MAXV;
for (int i = 0; i < n; i++) v[i] = i;
while (n > 1) {
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge &e =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | python3 | INF=1e20
while True:
n,m=map(int,input().split())
if (n|m)==0: break
res=INF
for i in range(m):
u,v,w=map(int,input().split())
res=min(res,w)
print(res) |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const long long MAX = LONG_LONG_MAX;
long long V, E;
bool used[101];
long long cnt;
struct Edge {
long long to, cost;
Edge() {}
Edge(long long _t, long long _c) : to(_t), cost(_c) {}
};
vector<Edge> G[101];
int f, t;
void check(long long x) {
if (used[x]) return;
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;
typedef long long ll;
struct info{ll from, to, cost;};
struct edge{ll to, cap, rev;};
const int MAX = 105;
vector<edge> G[MAX], cG[MAX];
bool used[MAX];
void add_edge(ll from, ll to, ll c... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long par[100], rnk[100];
void init(long long N) {
for (long long i = 0; i < N; i++) {
par[i] = i;
rnk[i] = 0;
}
}
long long find(long long x) {
if (par[x] == x) {
return x;
}
return par[x] = find(par[x]);
}
void unite(long long x, long long y) {
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
int x[100], y[100], c[100];
int r[100], tmp1, tmp2;
int cost, total;
int i, j;
while (1) {
cin >> n >> m;
if (!n && !m) break;
total = 0;
for (i = 0; i < m; i++) {
cin >> x[i] >> y[i] >> c[i];
total += c[i];
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include<iostream>
#include<algorithm>
#include<vector>
#define MAX_N 100
using namespace std;
typedef pair<int,int> P;
typedef pair<int, P > PP;
int n,m;
int par[MAX_N];
int rank[MAX_N];
void init(int);
int find(int);
void unite(int x,int y);
bool same(int,int);
PP e[MAX_N];
int main(){
int sum,cnt;
while(cin>>n... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 110
#define INF INT_MAX
typedef pair<int, int> pii;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) :
from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[MAX], cycle;
int color[MAX];
void dfs(int v, vector<Ed... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n > m);
long long sum = 0, mn = 1234567890123456789LL;
for (int i = 0; i < int(m); ++i) {
long long x, y, c;
cin >> x >> y >> c;
if (c ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int x[100], y[100], c[100];
bool use[100];
bool union_find(void) {
int i, j;
int tmp, tmp2;
int g[100];
for (i = 0; i < n; i++) g[i] = i;
for (i = 0; i < m; i++) {
if (g[x[i]] != g[y[i]] && !use[i]) {
tmp = g[x[i]];
for (j = 0; j < n; j++... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
int x[100], y[100], c[100];
int r[100], tmp1, tmp2;
int cost, total;
int i, j;
while (1) {
cin >> n >> m;
if (!n && !m) break;
total = 0;
for (i = 0; i < m; i++) {
cin >> x[i] >> y[i] >> c[i];
total += c[i];
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int src, dst;
long long weight;
Edge(int src, int dst, long long weight)
: src(src), dst(dst), weight(weight) {}
};
bool operator<(const Edge &e, const Edge &f) {
return e.weight != f.weight ? e.weight > f.weight
: e.src != f.src ? e... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
Edge &e =... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
struct Node {
int to;
int idx;
int flow;
Node(int to, int idx, int flow) : to(to), idx(idx), flow(flow) {}
};
class FordFulkerson {
private:
vector<Node>* _graph;
bo... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from, to, cost;
Edge(int from, int to, int cost) : from(from), to(to), cost(cost) {}
};
int N, M;
bool found;
vector<Edge> G[110], cycle;
int color[110];
void dfs(int v, vector<Edge> u) {
color[v] = 0;
for (int i = 0; i < (int)G[v].size(); i++) {
... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
struct Info {
Info(int arg_from, int arg_to, int arg_cost) {
from = arg_from;
to = arg_to;
cost = arg_cost;
}
int from, to, cost;
};
int N, M;
int boss[100], height[100];
int get_boss(int id) {
if (boss[id] == id)
return id;
else {
return boss[... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0 && m == 0) break;
assert(n >= m);
long long sum = 0, mn = 1234567890123456789LL, mn1 = 1234567890123456789;
vector<pair<int, int> > edge[n];
for (int i = 0; i < int(m); ++i) ... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
const int tx[] = {0, 1, 0, -1};
const int ty[] = {-1, 0, 1, 0};
int main() {
int num_of_houses;
int num_of_paths;
while (~scanf("%d %d", &num_of_houses, &num_of_paths)) {
if (num_of_houses == 0 && num_of_paths == 0) break;
int b... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
struct Dinic {
struct edge {
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int n;
vector<vector<edge> > G;
vector<map<int, int> > M;
vector<int> level, iter;
Dinic() {}
Dini... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
struct Dinic {
struct edge {
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int n;
vector<vector<edge> > G;
vector<map<int, int> > M;
vector<int> level, iter;
Dinic() {}
Dini... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline string toStr(T a) {
ostringstream oss;
oss << a;
return oss.str();
}
inline int toInt(string s) { return atoi(s.c_str()); }
bool isPrime(int a) {
for (int i = 2; i * i <= a; i++)
if (a % i == 0) return false;
return true;
}
bool is_pr... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
long long V, E;
bool used[101];
long long cnt;
struct Edge {
long long to, cost;
Edge() {}
Edge(long long _t, long long _c) : to(_t), cost(_c) {}
};
vector<Edge> G[101];
void check(long long x) {
used[x] = true;
cnt++;
for (long long i = 0; i < G[x].size(); i++)... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
struct Dinic {
struct edge {
int to, cap, rev;
edge() {}
edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev) {}
};
int n;
vector<vector<edge> > G;
vector<map<int, int> > M;
vector<int> level, iter;
Dinic() {}
Dini... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | //poj 3469 2987 å¿«äº
//////////èç¹å·ã1ï¼nã,source,sink 为å
¶ä¸ä»»æç¹
#include <cstdio>
#include <cstring>
#define maxn 132
typedef __int64 LL;
LL inf;
using namespace std;
struct edge
{
int u,v,next, pre; LL f;
}e[100000];
int num,rnum; int n,m,N; int source,sink;
int head[maxn],rhead[maxn], st... |
p00650 The House of Huge Family | Mr. Dango's family has an extremely huge number of members. Once it had about 100 members, and now it has as many as population of a city. It is jokingly guessed that the member might fill this planet in the near future.
Mr. Dango's family, the huge family, is getting their new house. Scale of the house is as large as... | {
"input": [
"3 2\n0 1 2\n1 2 1\n2 1\n0 1 100\n2 1\n0 1 0\n2 1\n0 1 -1\n0 0"
],
"output": [
"1\n100\n0\n-1"
]
} | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
return a < b && (a = b, 1);
}
int const inf = 1 << 29;
struct unicycle_graph {
int N;
using graph_type =... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
static int[] key = new int[256];
public static void main(String[] args) {
while (true) {
StringBuilder sb = new StringBuilder();
while (true) {
String line = sc.nextLine();
if (line.i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <cstring>
#include <climits>
using namespace std;
void solve(string s,string key){
int left = 0, right = 0;
int n = s.length(), m = key.length();
int minLen = INT_MAX, cnt = 0;
string minStr = "";
int level[256];
bool flg[256];
memset(flg,0,sizeof(flg));
memset(level,0,siz... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<list>
#include<set>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
int i;
string s;
while(getline(cin, s)){
string t=s,u;
while(getline(cin,s)){
if(s.length()==0)
break;
t+=s;
}
if(t... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>
#ifdef _MSC_VER
#include <agents... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <set>
#include <iostream>
#include <sstream>
#include <vector>
#include <cstdio>
#include <algorithm>
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
using namespace std;
int main(){
while(true){
stringstream ss;
string tm... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;
#define FOUND 1
#define NOT_FOUND -1
bool compare(string s1, string s2){
if(s1.size() == s2.size()) return s1 < s2;
return s1.size() < s2.size();
}
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
int need[255];
bool is_need[255];
void solve(string &a,int num){
pair<int,int> ans;
int tlength=a.size()+1,cnt=0;
int bef=0;
rep(i,a.size()){
if ( is_need[a[i]]==false)continu... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
string S,K;
const int n = 1<<8;
int getlen(){
int mx[n],res=1e9;
memset(mx,-1,sizeof(mx));
for(int i=0;i<S.size();i++){
int ch = S[i];
mx[ch] = max(mx[ch],i);
int c=0,l=1e9;
for(int j=0;j<K.size();j++)c+=mx[K[j]]>=0,l=min(l,mx[K[... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
#include<cmath>
#include<cstdio>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
using namespace std;
void compute(string text,string S)
{
int nt = text.size(),nS = S.size();
int mlen = inf;
string ans;
bool found[nS];
int CNT = 0;
int fpos[nS... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | //47
#include<iostream>
#include<sstream>
#include<string>
#include<map>
#include<algorithm>
#include<set>
using namespace std;
int main(){
for(string si;getline(cin,si),si!="";){
string s;
do{
s+=si;
getline(cin,si);
}while(si!="");
string k;
getline(cin,k);
bool ap[128]={};
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
using namespace std;
#define FOR(i,k,n) for(int i=(k); i<(int)(n);... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<cstdio>
#include<string>
#include<iostream>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
while(1){
string s,tmp;
while(1){
getline(cin,tmp);
if(tmp=="") break;
s+=tmp;
}
string a; getline(cin,a);
getline(cin,tmp);
if(a=="") break;
int m=a.length();
bool... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <queue>
#include <map>
#include <set>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | //47
#include<iostream>
#include<sstream>
#include<string>
#include<map>
#include<algorithm>
#include<set>
using namespace std;
int main(){
for(string si;getline(cin,si),si!="";){
string s;
do{
s+=si;
getline(cin,si);
}while(si!="");
string k;
getline(cin,k);
cin.ignore();
ma... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
#define MAX (1<<24)
int main()
{
string s;
while(getline(cin,s))
{
string str(s), sb;
while(getline(cin, s))
{
if(s.size()==0) break;
str+=s;
}
if(str.size()==0) break;
while(getline(cin, s))
{
i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
string buf;
while(getline(cin,buf),buf!=""){
string s=buf;
while(getline(cin,buf),buf!="") s+=buf;
string a;
getline(cin,a);
//cout<<s<<endl<<a<<endl;
int n=a.size();
vector<int> pos[n];
for(int i=0;i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
#define REP(i, a, b) for(int i = (a); i < int(b); ++i)
#define rep(i, n) REP(i, 0, n)
#define ALL(x) begin(x), end(x)
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
constexpr int NUM = 128;
constexpr i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
int main() {
while ( true ) {
string t;
string line;
while ( getline( cin, line ) && line.size() ) {
t += line;
}
getline( cin, line );
if ( !line.size() ) break;
string ... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
#include<map>
#include<cstring>
using namespace std;
const int MAX = 51;
string text, key;
map<char,int> M;
int numKey[MAX];
typedef long long ll;
bool input(){
text = "";
string s = "";
if(!getline(cin,s)) return false;
if(s == "") return false;
text = s;
while(getline(cin,s)&&s!="... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | java | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
//Co-occurrence Search
public class Main{
void run(){
Scanner sc = new Scanner(System.in);
boolean head = true;
while(sc.hasNext()){
if(!head)sc.nextLine();
StringBuilder sb = new StringBuilder();
for(;;){
String s = sc.next... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<cstdio>
#include<string>
#include<iostream>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
while(1){
string s,tmp;
while(1){
getline(cin,tmp);
if(tmp=="") break;
s+=tmp;
}
string a; getline(cin,a);
getline(cin,tmp);
if(a=="") break;
int m=a.length();
bool... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string S,K;
const int INF=1<<28;
void solve(){
string ans;
int len=INF, cnt=0;
int left=INF;
int idx[K.length()];
// fill(begin(idx), end(idx), 0);
for(int i=0; i<K.length(); ++i)idx[i]=-1;
for(int p=0; p<S.length(); ++p){
for(in... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | //47
#include<iostream>
#include<sstream>
#include<string>
#include<map>
#include<algorithm>
#include<set>
using namespace std;
int main(){
for(string si;getline(cin,si),si!="";){
string s;
do{
s+=si;
getline(cin,si);
}while(si!="");
string k;
getline(cin,k);
cin.ignore();
ma... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
int main()
{... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
public class Main{
//2116 start
private void doit(){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
ArrayList<Character> list = new ArrayList<Character>();
String input = sc.nextLine();
while(! input.equals("")){
for(int i = 0; i < input.length(); i++){
list.add(... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
string str, pat;
vector<char> num;
str.reserve(1000001);
num.reserve(1000001);
pat.reserve(73);
ios::sync_with_stdio(false);
cin.tie(0);
while(true){
str.clear();
pat.clear();
while(true){... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
const int INF=1000000000;
char chs[1001];
int main(){
bool fi=false;
string str;
while(getline(cin,str)&&str!=""){
memset(chs,0,sizeof(chs));
string ss;
string tmp;
if(fi)cou... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<algorithm>
using namespace std;
bool check(int begin, int end, vector<vector<int> > &ind){
if(begin>end)return false;
for(int i = 0; i < (int)ind.size(); ++i){
if(ind[i].size()==0)return false;
vector<int>::iterator it_b = lowe... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | java | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class Main{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
char[] s, key;
void run(){
for(;;){
StringBuffer lines=new StringBuffer();... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while(1) {
string s="",t,r;
getline(cin,s);
if(s=="") break;
while(1) {
getline(cin,r);
if(r=="") break;
s+=r;
}
getline(cin,t);
getline(cin,r);
map<char,int> m,d;
m.clear();
d.clear();
for(i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string text,key,temp;
for(;;)
{
text=key="";
while(getline(cin,text)&&text.empty())
;
if(cin.eof())return 0;
while(getline(cin,temp)&&!temp.empty())
text+=temp;
if(cin.eof())return 0;
while(getline(cin,key)&&key.empty())
;
i... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | /*
000000000011111111112222222222333333333344444444
012345678901234567890123456789012345678901234567
TfefirstemampleistrivivlTfefirstemampleistrifivl
. . .
len = 18 sp = 3
len = 15 sp = 11
len = 12 sp = 22
len = 12 sp = 35
mfv
000000000011111111112222222222
01234567890123456... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
template<class T1, class T2> v... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | CORRECT | cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
#define rep(i, n) for ( int i = 0; i < (int)n; i++)
bool T[256];
int P[256];
vector<string> compute(string text, string key){
vector<string> ans;
int k = key.size();
rep(i, 256) P[i] = -1;
int l = text.size();
int r = -1;
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
string s, t, temp;
int scnt[300], tcnt[300], ans[1000005], B[1000005], E[1000005];
int main() {
while (getline(cin, temp)) {
s = "";
s += temp;
while (1) {
getline(cin, temp);
s += temp;
if (temp == "") break;
}
getline(cin, temp);
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string in;
string key;
int size;
vector<int> pos;
int find[50];
while (cin >> in >> key) {
int l = 0, u = 0;
size = 10000000;
for (int i = 0; i < key.size(); i++) find[i] = 0;
pos.clear();
int nf = 0;
while (u < in.size()) {
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
string s, t, temp;
int scnt[300], tcnt[300], ans[1000005], B[1000005], E[1000005];
int main() {
while (getline(cin, temp)) {
s = "";
s += temp;
while (1) {
getline(cin, temp);
s += temp;
if (temp == "") break;
}
getline(cin, temp);
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int size = 51;
int cnt[size];
int ksize;
bool check() {
for (int i = 0; i < ksize; i++) {
if (cnt[i] == 0) return false;
}
return true;
}
int contain(string& K, char c) {
for (int i = 0; i < ksize; i++) {
if (c == K[i]) return i;
}
return -1;
}
voi... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
constexpr int NUM = 128;
constexpr int WIDTH = 72;
bool first = true;
string line;
while (getline(cin, line)) {
if (line.empty()) break;
if (first)
first = false;
else
cout << ... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
int main() {
string s;
while (getline(cin, s)) {
string t;
while (getline(cin, t), t != "") s += t;
string key;
getline(cin, key);
cin.ignore();
set<char> se;
map<char, int> mp;
for (__typeof((key).begin()) it = (... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
for (;;) {
string s;
for (;;) {
string tmp;
getline(cin, tmp);
if (tmp == "") break;
s += tmp;
}
int n = s.size();
string key;
getline(cin, key);
int m = key.size();
vector<bool> isKey(256, false);
f... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
bool first = true;
while (getline(cin, str)) {
if (!first) cout << endl;
string s = str;
while (getline(cin, str), str != "") {
s += str;
}
string key;
getline(cin, key);
int keyNum[1000];
memset(keyNum, -... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
string gText;
string gQuery;
vector<int> gIndex[256];
class State {
public:
int _min_pos;
int _max_pos;
int _query_i;
State(int min_pos, int max_pos, int query_i)
: _min_pos(min_pos), _max_pos(max_pos), _query_i(query_i) {}
b... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
while (getline(cin, s)) {
string str(s), sb;
while (getline(cin, s)) {
if (s.size() == 0) break;
str += s;
}
while (getline(cin, s)) {
if (s.size() == 0) break;
sb += s;
}
int ansl = (1 << 24), ret =... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
string gText;
string gQuery;
vector<int> gIndex[1024];
class State {
public:
int _min_pos;
int _max_pos;
int _query_i;
State(int min_pos, int max_pos, int query_i)
: _min_pos(min_pos), _max_pos(max_pos), _query_i(query_i) {}
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
string S, K;
const int INF = 1 << 28;
void solve() {
string ans;
int len = INF, cnt = 0;
int left = INF;
int idx[K.length()];
for (int i = 0; i < K.length(); ++i) idx[i] = -1;
for (int p = 0; p < S.length(); ++p) {
for (int k = 0; k < K.length(); ++k) {
... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
while (getline(cin, s)) {
string str(s), sb;
while (getline(cin, s)) {
if (s.size() == 0) break;
str += s;
}
while (getline(cin, s)) {
if (s.size() == 0) break;
sb += s;
}
int ansl = (1 << 24), ret =... |
p00795 Co-occurrence Search | A huge amount of information is being heaped on WWW. Albeit it is not well-organized, users can browse WWW as an unbounded source of up-to-date information, instead of consulting established but a little out-of-date encyclopedia. However, you can further exploit WWW by learning more about keyword search algorithms.
Fo... | {
"input": [
"Thefirstexampleistrivial.\n\nmfv\n\nAhugeamountofinformationisbeingheapedonWWW.Albeititisnot\nwell-organized,userscanbrowseWWWasanunboundedsourceof\nup-to-dateinformation,insteadofconsultingestablishedbutalittle\nout-of-dateencyclopedia.However,youcanfurtherexploitWWWby\nlearningmoreaboutkeywordsear... | {
"input": [],
"output": []
} | IN-CORRECT | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
constexpr int NUM = 128;
constexpr int WIDTH = 72;
string line;
while (getline(cin, line)) {
string text = "";
do {
text += line;
} while (getline(cin, line) && !line.empty());
str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.