output stringlengths 52 181k | instruction stringlengths 296 182k |
|---|---|
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int... | ### Prompt
Construct a cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
string s,t;
while(cin >> s&&s!="."){
cin >> t;
vector<string> v1,u1,v2,u2;
bool flag = 0;
string tmp;
for(int i=0;i<s.size();i++){
if(s[i]=='"'&&!flag){
v1.p... | ### Prompt
Your task is to create a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
vector<string> f(string s){
vector<string> ret;
string a = "";
for(auto c:s){
if(c == '"'){
ret.push_back(a);
a = "";
}else{
a += c;
}
}
ret.push_... | ### Prompt
Please create a solution in cpp to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include <bits/stdc++.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;
string S,T;
void solve(){
if(S==T){
cout<<"IDENTICAL"<<endl;
return;
}
vector<string> a,b;
vector<string> x,y;
bool flag=false;
string tmp;
string rest="";
for(int i=0;i<S.size();i++){
if(S[i]=='"')... | ### Prompt
Create a solution in CPP for the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as ... |
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
using namespace std;
int main(){
while(true){
string str1, str2;
cin >> str1;
if(str1[0] == '.' && str1.size() == 1){
break;
}
cin... | ### Prompt
Your task is to create a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
while(cin >> s, s != "."){
string t;
cin >> t;
vector<string> v, w;
v.push_back("");
for(int i = 0 ; i < s.size() ; ++i){
if(s[i] == '"'){
v.push_back("");
}else{
... | ### Prompt
In CPP, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include<iostream>
using namespace std;
int main(){
char s1[200]={0};
char s2[200]={0};
char t1[200]={0};
char t2[200]={0};
char u1[200]={0};
char u2[200]={0};
int c=0,flag=0,j=0,k=0,l=0;
for(int x=0;x<100;x++){
cin>>s1;
if(s1[0]=='.') break; //input
cin>>s2;
for(int i=0;i... | ### Prompt
Your task is to create a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
string s, s2;
string t, t2;
vector<string> vec, vec2;
string calc(string s, vector<string> &vec)
{
string t, u; bool flag = false;
vec.clear();
for(int i = 0; i < s.size(); i++){
if(flag){
if(s[i] == '\"'){
flag = fa... | ### Prompt
Construct a Cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include<iostream>
#include<string>
using namespace std;
bool close(string s1,string s2){
bool in_db_quo=false;
int index1=0;
int index2=0;
int times=0;//一致していない二重引用符
int l_of_sen1=s1.length(),l_of_sen2=s2.length();
while(true){
if(!in_db_quo){
if(s1[index1]=='"' && s2[index2... | ### Prompt
Please formulate a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se... | ### Prompt
Please formulate a CPP solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include<bits/stdc++.h>
using namespace std;
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl... | ### Prompt
Your challenge is to write a CPP solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
void split(string s, vector<string>&v){
s+='"';
v.clear();
string tmp = "";
for(int i=0;i<s.size();i++){
if(s[i]=='"'){
v.push_back(tmp);
tmp="";
}
else{
tmp+=s[i];
... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <iostream>
#include <string>
using namespace std;
#define REP(i, n) for(int i=0; i<n; i++)
string s1, s2;
int main() {
while(1) {
cin >> s1;
if (s1 == ".") break;
cin >> s2;
int error = 0;
int ap = 0;
int i=0, j=0;
while (1) {
if (i==s... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include<iostream>
#include<vector>
using namespace std;
string s,t;
int main()
{
while(cin>>s,s!=".")
{
cin>>t;
vector<string>a,b;
string now="";
for(int i=0;i<s.size();i++)
{
if(s[i]=='"')
{
a.push_back(now);
now="";
}
else now+=s[i];
}
a.push_back(now);
now="";
for(int i=0;i<t... | ### Prompt
Please formulate a CPP solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include<iostream>
#include<sstream>
using namespace std;
int main(){
while(1){
string s1,s2;
cin>>s1;
if(s1==".")return 0;
cin>>s2;
string s11[201],s22[201];
for(int i=0;i<201;i++){
s11[i]=".";s22[i]=".";
}
s11[0]="";s22[0]="";
int now1=0,now2=0;
for(int i=0;i<(int)s1.length();i++){
if(s1[i... | ### Prompt
Construct a cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include <iostream>
#include <string>
using namespace std;
int main(void){
string p = "\"";
string s1,s2;
string a[300]={},b[300]={};
int i=0,n,m,x=0,y=0;
int count = 0;
while(1){
cin >> s1;
if(s1 == ".") break;
n = s1.size();
cin >> s... | ### Prompt
Your challenge is to write a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include<iostream>
#include<vector>
#include<string>
using namespace std;
struct moji{
string st;
bool is_t;
};
void create_st(string& s,vector<moji>& sv){
for(int i=0;i<s.size();i++){
if(s[i]!='"') {
string tmp(1,s[i]);
moji add={tmp,false};
sv.push_back(add);
}else{
... | ### Prompt
Construct a cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include <bits/stdc++.h>
using Int = int64_t;
std::vector<std::string> f(std::string ss) {
std::vector<std::string> res;
std::string buf;
for(char c : ss) {
if( c == '\"' ) {
res.push_back(buf);
buf.clear();
}
else {
buf.push_back(c);
}
}
res.push_back(... | ### Prompt
Please provide a Cpp coded solution to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <bits/stdc++.h>
using namespace std;
int main(){
string s,t;
while(true){
cin>>s;
if(s==".")break;
cin>>t;
int errcnt=0;
int sind=0,tind=0;
while(sind<s.size()&&tind<t.size()){
if(s[sind]!=t[tind]){
errcnt=2019;
... | ### Prompt
Develop a solution in Cpp to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include<iostream>
#include<string>
using namespace std;
int main(){
while(true){
string s1, s2;
cin >> s1;
if(s1 == ".") break;
cin >> s2;
//?????¨??????????????´???
if(s1 == s2){
cout << "IDENTICAL" << endl;
continue; //??\??????while?????????????????????????????????while??????????????????
}
... | ### Prompt
Construct a CPP code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
string a,b;
int main(){
while(1){
cin>>a;
if(a == ".") return 0;
cin >> b;
if(a == b) { ... | ### Prompt
Your challenge is to write a CPP solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <bits/stdc++.h>
using namespace std;
typedef int_fast32_t int32;
typedef int_fast64_t int64;
const int32 inf = 1e9+7;
const int32 MOD = 1000000007;
const int64 llinf = 1e18;
#define YES(n) cout << ((n) ? "YES\n" : "NO\n" )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n" )
#define POSSIBLE(n) cout << ((n) ?... | ### Prompt
Develop a solution in Cpp to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include<iostream>
#include<sstream>
using namespace std;
int main(){
while(1){
string s1,s2;
cin >> s1;
if(s1 == ".") return 0;
cin >> s2;
string s11[201], s22[201];
for(int i=0;i<201;i++){
s11[i] = "."; s22[i] = ".";
}
int now1=0,now2=0;
for(int i=0;i<(int)s1.length();i++){
if(s1[i] == '"'){... | ### Prompt
In Cpp, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
string S, T;
while(cin >> S, S != ".") {
cin >> T;
int beet = 0;
string latte, malta;
vector< string > oi, ushi;
for(int i = 0; i < S.size(); i++) {
if(beet % 2 == 0) latte += S[i], oi.push_back("");
else oi.back() += S[i];... | ### Prompt
Please formulate a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void split(string s, vector<string> &v){
string tmp = "";
for(int i = 0; i < s.size(); i++){
if(s[i] == '"'){
v.push_back(tmp);
tmp = "";
}
else tmp += s[i];
}
if(tmp != "")v.push_back(tm... | ### Prompt
Please formulate a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include <bits/stdc++.h>
using namespace std;
vector<pair<string, bool> > Parse_String(string &S) {
vector<pair<string, bool> > res;
bool flg = false;
for(int i = 0; i < S.size(); ) {
int j = i; // [i, j)
while(j < S.size() && S[j] != '"') ++j;
res.push_back(pair<st... | ### Prompt
Please formulate a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout.precision(12);
cout.setf(ios_base::fixed, ios_base::floatfield);
string s1, s2;
while(true){
cin >> s1;
if(s1 == ".") break;
cin >> s2;
vector<strin... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include<bits/stdc++.h>
using namespace std;
#define PB push_back
void f(string s,string t){
vector<string> sv,sw,tv,tw;
int j=0;
string u;
for(int i=0;i<s.size();i++){
if(s[i]=='\"'){
if(j%2){
sw.PB(u);
}
else{
sv.PB(u);
}
u="";
j++;
}
else{
... | ### Prompt
Generate a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as a ... |
/* -*- coding: utf-8 -*-
*
* 1617.cc: Almost Identical Programs
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeri... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int start,end;
string s1,s2;
while(1){
cin>>s1;
if(s1==".") return 0;
cin>>s2;
vector<string> i1(0);
vector<string> i2(0);
//s1
start=0,end=-1;
for(int i=0;i<s1.size();i++){
if(s1[... | ### Prompt
Your task is to create a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include<iostream>
#include<sstream>
#include<string>
int main(){
while(1){
std::string str1,str2;
std::cin>>str1;
if(str1==".") break;
std::cin>>str2;
std::string s11[201],s22[201];
for(int i=0;i<201;i++){
s11[i]=".";s22[i]=".";
}
s11[0]="";s22[0]="";
... | ### Prompt
Please formulate a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include <iostream>
using namespace std;
int main() {
while(true) {
string s1;
cin>>s1;
if(s1==".")
break;
string s2;
cin>>s2;
bool foundDiff=false;
bool different=false;
auto it1=s1.begin(),it2=s2.begin();
for(;it1!=s1.end()&&it2!=s2.end();++it1,++it2){
if(*it1!=*it2){... | ### Prompt
Generate a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as a ... |
#include <bits/stdc++.h>
#define test(a) printf("(%3d)", a)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int MAXN = 5e4 + 10;
string a, b;
int i, j, cnt;
int flag1, flag2;
char str[205], tex[205];
int main (void) {
while (~scanf("%s", str) && str[0] != '.') {
scanf("%s... | ### Prompt
Please provide a cpp coded solution to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
string a[2],b;
string s[2][1001];
int p[2];
void dfs(int x){
r(i,a[x].size()){
if(a[x][i]=='"'){
i++;s[x][p[x]]+='"';
while(i<a[x].size()&&a[x][i]!='"')s[x][p[x]]+=a[x][i++];
p[x]++;
}else{
while(i<a[x].si... | ### Prompt
Please provide a CPP coded solution to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
bool check(string s1,string s2){
int l=0,r=0;
bool flag=false;
int cnt=0;
while(l<s1.size() || r<s2.size()){
if(s1.size()==l || s2.size()==r)return false;
if(s1[l]!=s2[r])return false;
if(s1[l]=='"'){
l++;
stri... | ### Prompt
Construct a cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool solve(){
char s[500],t[500];
ll n,m,i,j;
cin >> s;
n = strlen(s);
if(n == 1 && s[0] == '.')return false;
cin >> t;
m = strlen(t);
ll check = 0;
ll reads = 0,readt = 0;
ll sums = 0,sumt = 0;
ll semicount ... | ### Prompt
Please provide a Cpp coded solution to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
bool equal(string s1,string s2){
if(s1==s2)return true;
return false;
}
bool close(string s1,string s2){
bool in_db_quo=false;
int index1=0;
int index2=0;
int times=0;//一致していない二重引用符
int l_of_sen1=s1.length(),l_of_... | ### Prompt
Construct a cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <cstring>
#include <utility>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
bool check(string s1,string s2){
int l=0,r=0;
int cnt=0;
... | ### Prompt
Your task is to create a CPP solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include<iostream>
#include<string>
using namespace std;
int makeStrExceptQuo( string s, string a[100], string b[100] )
{
int index = 0, index2 = 0, cnt = 0;
bool sw = 0;
for( int i = 0; i < s.size(); i++ )
{
if( sw == 0 && s[i] != '"' )
b[index2] += s[i];
else if( sw == 0 &... | ### Prompt
Your task is to create a CPP solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<string> split(string s){
vector<string> ret;
string t="";
for(int i=0;i<s.size();i++){
if(s[i]=='"'){
ret.push_back(t);
t="";
}
else t+=s[i];
}
ret.push_back(t);
return ret;
}
int main (){
string s,t;
while(cin... | ### Prompt
Please create a solution in cpp to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include "bits/stdc++.h"
using namespace std;
typedef pair<string, int> token;
int main() {
string s1, s2;
while (cin >> s1, s1 != ".") {
cin >> s2;
vector<token> v1, v2;
int pos = 0;
while (pos < s1.size()) {
if (s1[pos] == '"') {
pos++;
string s = "";
while (pos < s1.size() && s1[pos] != '"')... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include<iostream>
#include<sstream>
#include<string>
int main(){
while(1){
std::string str1,str2;
std::cin>>str1;
if(str1==".") break;
std::cin>>str2;
std::string s1[201],s2[201];
for(int i=0;i<201;i++){
s1[i]=".";s2[i]=".";
}
s1[0]="";s2[0]="";
int now1=0,now2=0;
int l... | ### Prompt
In Cpp, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include <bits/stdc++.h>
using namespace std;
bool is_identical(string s1, string s2)
{
return s1 == s2;
}
string s1, s2;
int main()
{
while (true)
{
int cnt = 0;
cin >> s1;
if (s1[0] == '.')
break;
cin >> s2;
int end1=0,end2 = 0;
int start = 0;
... | ### Prompt
Please create a solution in Cpp to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accept... |
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long int i=0;i<n;++i)
typedef long long int ll;
int main(){
while(1){
string s,t;
cin >> s;
if(s==".")break;
cin >> t;
vector<string> ss,tt;
string te="";
for(int i=0;i<s.size();i++){
... | ### Prompt
In cpp, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include <iostream>
#include <string>
using namespace std;
int main(){while(true){
string s1;
cin>>s1;
if(s1==".")
return 0;
string s2;
cin>>s2;
if(s1==s2){
cout<<"IDENTICAL"<<endl;
continue;
}
string t1=s1;
string t2=s2;
while(true){
size_t d1b=t1.find('\"'); //d1_begin
if(d1b==string::npos)
bre... | ### Prompt
Your challenge is to write a CPP solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
while(true){
int wrongTime = 0;
string str_in;
string str_ans;
vector <string> sub_in;
vector <string> sub_ans;
//input--------------------
cin >> str_in;
if( str_in == ".") break;
cin>> str_... | ### Prompt
In CPP, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include <stdio.h>
#include <string.h>
int main(void) {
while(1) {
//入力
char str1[201], str2[201];// 問題文ではs1,s2となっています。
scanf("%s", str1);
if(str1[0] == '.' && str1[1] == '\0') break;
scanf("%s", str2);
//処理
if(strcmp(str1, str2) == 0){
printf("IDENTICAL\n"); //2つの文字列は完全に一致したなら、IDENTICALを出力。
cont... | ### Prompt
In Cpp, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include<bits/stdc++.h>
using namespace std;
using i64 = int64_t;
int main(){
string s1;
while(cin >> s1, s1 != "."){
string s2;
cin >> s2;
if(s1 == s2){
cout << "IDENTICAL" << endl;
continue;
}
int n1 = 0, n2 = 0;
for(auto c: s1){
... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#includ... | ### Prompt
Construct a Cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include <bits/stdc++.h>
using namespace std;
char stra[1000], strb[1000];
int lena, lenb;
int main()
{
// freopen("a.in", "r", stdin);
// freopen("out.txt", "w", stdout);
while(true)
{
memset(stra, 0, sizeof(stra));
memset(strb, 0, sizeof(strb));
scanf("%s", stra);
lena = strlen(stra);
if(stra[0] == '.')
... | ### Prompt
Please provide a cpp coded solution to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <regex>
using namespace std;
vector<string> split(const string &s, regex delim) {
vector<string> res;
sregex_token_iterator itr(s.begin(), s.end(), delim, -1), end;
for(; itr!=end; itr++){
/*if(*itr != "")*/ res.push_back(*itr);
... | ### Prompt
In Cpp, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include <stdio.h>
#include <string.h>
int main() {
while (1) {
char s1[210];
char s2[210];
scanf("%s", s1);
if (s1[0] == '.') break;
scanf("%s", s2);
int n1 = strlen(s1);
int n2 = strlen(s2);
if (n1 == n2) {
bool j = true;
for (int i = 0; i < n1; i++) {
if (s1[i] != s2[i]) {
j = fal... | ### Prompt
In CPP, your task is to solve the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed
main(){
while(1)
{
string a,b;
cin >> a;
if(a == ".") break;
cin >> b;
int err_cnt = 0;
vector<string> st_a, st_b;
vector<string> oth_a, oth_b;
int oa_cnt = 0,ob_cnt = 0;
oth_a.push_back("");
ot... | ### Prompt
Your task is to create a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
while(1){
string s1,s2;
cin >> s1;
if(s1 == ".") break;
cin >> s2;
vector<string> moji1,moji2,code1,code2;
int last = 0;
int dq = 0;
for(int i = 0;i < s1.size();i++){
if(s1[i] == '"'){
dq++;
if(i != 0)... | ### Prompt
Your task is to create a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<numeric>
using namespace std;
#define R(i,s,n) for(int i=s;i<n;i++)
#define D(i,n,s) for(int i=n-1;i>=s;i--)
typedef pair<int,int> P;
string s1,s2;
st... | ### Prompt
Your task is to create a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
for(;;) {
string s, t;
cin >> s;
if(s == ".") break;
cin >> t;
auto f = [](string &str, vector<string> &ts, vector<string> &ss) {
int n = str.length();
for(;;) {
int ... | ### Prompt
Generate a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as a ... |
#include<iostream>
#include<sstream>
#include<string>
using namespace std;
int main(){
while(1){
string s1,s2;
cin>>s1;
if(s1==".")return 0;
cin>>s2;
string s11[201],s22[201];
for(int i=0;i<201;i++){
s11[i]=".";s22[i]=".";
}
s11[0]="";s22... | ### Prompt
Generate a Cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as a ... |
#include<iostream>
int wrong_count(char a1[],char a2[]){
//std::cout << a1 << ' ' << a2 << '\n';
int i=0;
if(a1[i] == '\0' && a2[i] == '\0') return 0;
do{
if(a1[i] == a2[i]){
i++;
if(a1[i] == '\0' && a2[i] == '\0') return 0;
}else{
//std::cout << "ret... | ### Prompt
Construct a cpp code solution to the problem outlined:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted ... |
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
string s, t;
string S, T;
vector<string> vecs, vect;
int main(void)
{
while(1){
cin >> s;
if(s == ".") break;
cin >> t;
S = "", T = "";
vecs.clear(), vect.clear();
{
bool in = false;
string buf;
for(int i = 0; i < s... | ### Prompt
Create a solution in cpp for the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be accepted as ... |
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const int MOD =... | ### Prompt
Your task is to create a cpp solution to the following problem:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to be ... |
#include <bits/stdc++.h>
using namespace std;
string s1,s2;
int main(){
while(1){
string ss1[200],ss2[200];
string tt1[200],tt2[200];
s1="";
s2="";
cin>>s1;
if(s1[0]=='.') break;
cin>>s2;
int pc1=0,kc1=0,cnt=0;
for(int i=0;i<s1.size();i++){
if(s1[i]=='"'){
cnt++;
if(cnt==2){
pc1++;... | ### Prompt
Please provide a CPP coded solution to the problem described below:
Almost Identical Programs
The programming contest named Concours de Programmation Comtemporaine Interuniversitaire (CPCI) has a judging system similar to that of ICPC; contestants have to submit correct outputs for two different inputs to... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <complex>
#include <vector>
#include <cmath>
using namespace std;
#define MAXN (17)
#define INF (1<<29)
#define X real()
#define Y imag()
typedef complex<double> P;
template<class T>
inline T Sq(T x) { return x*x; }
inline double getDist(P,... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#include <cstdio>
#include <algorithm>
#include <complex>
#include <vector>
#include <cmath>
using namespace std;
#define MAXN (14)
#define INF (1<<29)
#define X real()
#define Y imag()
typedef complex<double> P;
template<class T>
inline T Sq(T x) { return x*x; }
inline double getDist(P, P);
struct Segment ... | ### Prompt
Generate a cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line... |
#include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
using namespace std;
const double INF = 1e30;
typedef complex<double> P;
double dp[14][2][1<<14];
int main()
{
int caseNum = 0;
int N;
while(cin >> N, N) {
vector<P> points(2*N);
double sum = 0;
for(int i=0; i<N; i++) {
double ... | ### Prompt
Construct a cpp code solution to the problem outlined:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing... |
#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);... | ### Prompt
Please provide a Cpp coded solution to the problem described below:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#include <cstdio>
#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 ... | ### Prompt
Your task is to create a cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two... |
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
double sqr(double x){
return x*x;
}
int main(){
for(int n,c=1;cin>>n,n;c++){
double x[14][2],y[14][2];
double ll=0;
for(int i=0;i<n;i++){
for(int j=0;j<2;j++){
cin>>x[i][j]>>y[i][j];
}
ll+=sqrt(sqr(x[i][0]-... | ### Prompt
In Cpp, your task is to solve the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing l... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <complex>
#include <vector>
#include <cmath>
using namespace std;
#define MAXN (14)
#define INF (1<<29)
#define X real()
#define Y imag()
typedef complex<double> P;
template<class T>
inline T Sq(T x) { return x*x; }
inline double getDist(P,... | ### Prompt
Develop a solution in CPP to the problem described below:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two exist... |
#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... | ### Prompt
Generate a Cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line... |
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
using namesp... | ### Prompt
Your task is to create a Cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pa... | ### Prompt
Develop a solution in cpp to the problem described below:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two exist... |
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
#define MAX 15
#define INF 1e9
struct Point{
double x,y;
Point(){}
Point(double x,double y) : x(x), y(y) {}
};
struct Segment{
Point s,t;
Segment(){}
Segment(Point s,Point t) : s(s), t(t) {}
};
int N;
doubl... | ### Prompt
Your challenge is to write a CPP solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#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);... | ### Prompt
Please provide a cpp coded solution to the problem described below:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<functional>
#include<iomanip>
using namespace std;
const int N = 16;
const double infty = 1e80;
struct state{
int cur;
int type;
int vis;
double cost;
state(int cur, int type, int vis, double cost):cur(cur),type... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#include<cmath>
#include<cstdio>
#include<algorithm>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const double INF=1e77;
struct point{
double x,y;
point():x(0),y(0){}
point(double x,double y):x(x),y(y){}
point operator-(const point &a)const{ return point(x-a.x,y-a.y); }
};
double abs(const poin... | ### Prompt
Your challenge is to write a CPP solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#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);... | ### Prompt
Generate a cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cassert>
#include<climits>
#include<map>
#include<set>
#include<iomanip>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define IINF (INT_MAX)
#define EPS 1e-6
#define equals(a,b) (fabs((a)-(b)) < EPS)
#define MAX 20
... | ### Prompt
In CPP, your task is to solve the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing l... |
#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);... | ### Prompt
Please create a solution in CPP to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two exist... |
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <climits>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <map>
#include <tuple>
#include <iostream>
#include <deque>
#include <array>
#include <set>
#include <functional>
#include <memory>
#include <stack>
#include <num... | ### Prompt
Generate a cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line... |
#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... | ### Prompt
Please formulate a CPP solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two exist... |
#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++)
const int inf = 1LL << 55;
const int mod = 1e9 + 7;
struct Point{
double x,y;
Point(){}
Point(d... | ### Prompt
Please provide a cpp coded solution to the problem described below:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
double X1[20];
double Y1[20];
double X2[20];
double Y2[20];
double dp[1<<14][14][2];
int main(){
int T=0;
int a;
while(scanf("%d",&a),a){
for(int i=0;i<a;i++)scanf("%lf%lf%lf%lf",X1+i,Y1+i,X2+i,Y2+i);
for(int i=0;i<(1<<a);i++)for(int j=0... | ### Prompt
Construct a cpp code solution to the problem outlined:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing... |
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* c... | ### Prompt
Generate a Cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line... |
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld= long double;
ld get_dis(const pair<ld,ld>&l,const pair<ld, ld>&r) {
return sqrt((l.first-r.first)*(l.first-r.first)+(l.second-r.second)*(l.second-r.second));
}
ld dfs(vector<vector<... | ### Prompt
In cpp, your task is to solve the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing l... |
#include <bits/stdc++.h>
#define N 14
using namespace std;
int n;
typedef pair<double,double> P;
typedef pair<P,P> PP;
double X[N],Y[N],X2[N],Y2[N];
double dis(double x,double y,double x2,double y2){
return sqrt((x-x2)*(x-x2)+(y-y2)*(y-y2));
}
map<P,double> mem[1<<N];
double dfs(double x,double y,int bit){
if(b... | ### Prompt
Generate a Cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line... |
#include<bits/stdc++.h>
#define INF (1e9)
#define MAX_N 14
using namespace std;
typedef complex<double> P;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
std::fill( (T*)array, (T*)(array+N), val );
}
int n;
double x,y;
double dp[(1<<MAX_N)][MAX_N*2];
vector<P> v;
int main(){
i... | ### Prompt
Generate a Cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line... |
#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const double INF = 1e12;
typedef complex<double> P;
int main(){
for(int rep=1; ; rep++){
int n;
cin >> n;
if(n==0) break;
vector<vector<P> > seg(n,... | ### Prompt
Create a solution in CPP for the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing li... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <complex>
#include <vector>
#include <cmath>
using namespace std;
#define MAXN (14)
#define INF (1<<29)
#define X real()
#define Y imag()
typedef complex<double> P;
template<class T>
inline T Sq(T x) { return x*x; }
inline double getDist(P,... | ### Prompt
Your challenge is to write a Cpp solution to the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>... | ### Prompt
Construct a CPP code solution to the problem outlined:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing... |
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef pair<double,double> P;
double D(P a, P b){return sqrt((a.F-b.F)*(a.F-b.F)+(a.S-b.S)*(a.S-b.S));}
int main() {
int n,tt=1;
while(cin >> n && n) {
P a[n][2];
for(int i=0; i<n; i++) {
for(int j=0; j<2; j++) cin >> a[i... | ### Prompt
Create a solution in Cpp for the following problem:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing li... |
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int n; long double sx[16], sy[16], tx[16], ty[16], dp[1 << 15][15][2];
long double dst(long double ax, long double ay, long double bx, long double by) {
return sqrt((ax - bx)*(ax - bx) + (ay - by)*(ay - by));
}
int main() {
int d = 0;
while ... | ### Prompt
Please provide a CPP coded solution to the problem described below:
Your dear son Arnie is addicted to a puzzle named Connect Line Segments.
In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define mp make_pair
#define INF (1<<28)
inline void cmin(int &a, int b) { if(a>b) a = b; }
typedef pair<int, int>... | ### Prompt
Please provide a cpp coded solution to the problem described below:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness agai... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
#include <cstring>
using namespace std;
#define MAX 10000
#define INF 1e9
typedef pair<int,int> P;
int ans, N;
vector<P> vec[MAX];
int dp[100][100];
int dist(int x1, int y1, int x2, int y2){
return abs(x1-x2) + abs(y1-y2);
}
int getN... | ### Prompt
Develop a solution in cpp to the problem described below:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness again.
The De... |
#include<iostream>
#include<queue>
#include<cstring>
#include<stdlib.h>
#include<algorithm>
#include<math.h>
#include<map>
#define INF 1<<21
using namespace std;
typedef pair<int,int> P;
queue< P > houzyu[10005];
int w,h;
char maps[102][102][10];
int ruiseki[102][102];
int sx,sy,gx,gy;
int n=0;
int dp[105][105]={0};
in... | ### Prompt
Create a solution in CPP for the following problem:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness again.
The Demon Ki... |
#include <iostream>
#include <map>
#include <queue>
#include <vector>
#include <cstdlib>
#define P pair<int,int>
using namespace std;
int main(){
int w,h;
P g;
string s;
while( cin>>w>>h && (w|h) ){
vector<P> p[100*100];
map<int,int> mp;
int n=1, nodeN=1;
for( int i=0;i<h;i++ ){
for( int... | ### Prompt
In Cpp, your task is to solve the following problem:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness again.
The Demon K... |
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <sstream>
#include <algorithm>
using namespace std;
int dp[2505][2505];
int todig(string a)
{
stringstream ss(a);
int res;
ss >> res;
return res;
}
int main()
{
int W,H;
while(cin >> W >> H, W||H){
int gx,... | ### Prompt
Construct a CPP code solution to the problem outlined:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness again.
The Demon... |
#include <bits/stdc++.h>
using namespace std;
#define LOG(...) fprintf(stderr,__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!... | ### Prompt
Please provide a Cpp coded solution to the problem described below:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness agai... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2e5 + 5);
const double EPS = 1e-8;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#def... | ### Prompt
Please create a solution in CPP to the following problem:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness again.
The De... |
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int ABS(int a){return max(a,-a);}
char in[11];
int m[120][120];
vector<pair<int,int> >at[11000];
int dp[120][120];
int main(){
int a,b;
while(scanf("%d%d",&b,&a),a){
for(int i=0;i<11000;i++)at[i].clear();
int n=0;
for(int i=0;i<a;i++... | ### Prompt
Your task is to create a CPP solution to the following problem:
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness again.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.