Search is not available for this dataset
name
stringlengths
2
112
description
stringlengths
29
13k
source
int64
1
7
difficulty
int64
0
25
solution
stringlengths
7
983k
language
stringclasses
4 values
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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]; ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
s=[] while True: l1=input() if l1==".": break l2=input() sp1=l1.split('"') sp2=l2.split('"') m=0 if len(sp1)==len(sp2): for i in range(len(sp1)): if i%2==1 and sp1[i]!=sp2[i]: m+=1 elif i%2!=1 and sp1[i]!=sp2[i]: ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while True: s1 = input() if s1 == '.': break s2 = input() if s1 == s2: print("IDENTICAL") continue s2 = s2.split('"') s1 = s1.split('"') # print(s1) # print(s2) count = 0 isTmp = False if s1[0] == '"' and s2[0] == '"': isTmp = True hoge ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
def testcase_ends(): s = input() if s == '.': return True t = input() if s == t: print('IDENTICAL') return False s0 = s.split('"')[0::2] s1 = s.split('"')[1::2] t0 = t.split('"')[0::2] t1 = t.split('"')[1::2] if s0 != t0: print('DIFFERENT') ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**13 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int(x) for x in sys.stdin....
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str1 = scan.nextLine(); String str2; while(!str1.equals(".")){ str2 = scan.nextLine(); if(str1.equals(str2)){ System.out.println("IDENTICAL"); }else{ int i = 0; ...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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{ ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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(...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { static int[][] map; static int[][] directions8 = { { -1, -1 }, { -1, 0 }, { -1, 1 }, { 0, -1 }, { 0, 1 }, { 1, -1 }, { 1, 0 }, { 1, 1 } }; static int[][] directions4 = { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 } };...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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; ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
from functools import lru_cache ans = ['IDENTICAL', 'DIFFERENT', 'CLOSE'] def compare(s1,s2): if s1 == s2: return 0 l1,l2 = s1.split('"'),s2.split('"') if len(l1) != len(l2): return 1 cnt = 0 for i in range(len(l1)): if i%2 == 0: if l1[i] != l2[i]: ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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?????????????????? } ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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) { ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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) ?...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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] == '"'){...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while 1: list1=input().split('"') if list1[0]==".": break list2=input().split('"') cnt1=0 cnt2=0 flag=0 if len(list1)!=len(list2): print("DIFFERENT") else: i=0 while i<len(list1): if list1[i]==list2[i]: cnt1+=1 ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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];...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.util.Scanner; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { Scanner as = new Scanner(System.in); while(true) { String m = as.next(); if(m.equals(".")) { break; } int s = 0; boolean ss = false; String m2 = as.next(); Pattern p = Pa...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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{ ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
/* -*- 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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while 1: s1 = input().split('"') if s1 == ['.']: # 強制終了 break s2 = input().split('"') if len(s1) != len(s2): # 長さが違う場合 print("DIFFERENT") continue cnt = 0 for i in range(len(s1)): if s1[i] != s2[i]: cnt += 1 if i%2==0: ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while True: S_1 = input() if S_1 == '.': break S_2 = input() if S_1 == S_2: print("IDENTICAL") continue A = [0] B = [0] for i, s in enumerate(S_1): if s == '"': A.append(i) for i, s in enumerate(S_2): if s == '"': B.append(i) if len(A) != len(B): print(...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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[...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
def is_same(s1, s2): sp1 = s1.split("\"") sp2 = s2.split("\"") if len(sp1) != len(sp2): return 2 count = 0 for i in range(len(sp1)): if i % 2 == 0: if sp1[i] != sp2[i]: return 2 else: if sp1[i] != sp2[i]: count += 1 if count >= 2: return 2 return ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
def check(str1,str2): if not(len(str1)==len(str2)): return False for i in range(len(str1)): if not(str1[i]==str2[i]): return False return True def solve(s1,s2): #print(len(s1),len(s2)) if not(len(s1) == len(s2)): print("DIFFERENT") return flag = Tru...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while 1: s1 = input().split('"') if s1 == ['.']: break s2 = input().split('"') if len(s1) != len(s2): print("DIFFERENT") continue r = [0]*2 for i in range(len(s1)): if s1[i] != s2[i]: r[i%2] += 1 if [0,1]<r: print("DIFFERENT") else: ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while (True): s1=input() if (s1=="."): break s2=input() l1=s1.split("\"") l2=s2.split("\"") #print(l1,l2) if (len(l1)!=len(l2)): print("DIFFERENT") continue error=0 for i in range(len(l1)): #print(l1,l2,i) if (l1[i]!=l2[i] and i%2==0): ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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]=""; ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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){...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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 ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(true){ String input1 = br.readLine(); if(input1.eq...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.util.*; class Main { public static void main(String[] args) { Scanner cin=new Scanner(System.in); while(true) { String str1=cin.next(); if(str1.equals("."))break; String str2=cin.next(); String[] stra1=str1.split("\"",-1);...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while(1): s = input() if s=='.': break s = list(s.split('"')) t = list(input().split('"')) if len(s) != len(t): print("DIFFERENT") else: cnt=0 ss=len(s) for i in range(ss): if i%2==0 and s[i]!=t[i]: cnt=100 elif i%2==1 and s...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.util.*; class Main{ public static void main(String[] A){ Scanner s=new Scanner(System.in); while(true){ String a=s.next().replaceAll("\""," \""); if(a.equals(".")) return; String b=s.next().replaceAll("\""," \""); String[] aa=a.split("\""),bb=b.split("\""); if(aa.length!=bb.lengt...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while 1: s = input() if s=='.': break s=list(s.split('"')) t=list(input().split('"')) if s==t: print("IDENTICAL") elif len(s)!=len(t): print("DIFFERENT") continue else: flag = 0 for i in range(0,len(s),2): if s[i] != t[i]: ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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_...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#2行の文字列を受け取る while True: str1 = input() if str1 == ".": break str2 = input() #完全一致か判定する→「完全一致なら:XXXxとだす」 if str1 == str2: print("IDENTICAL") continue #完全一致じゃない場合は→""でsplitする→頭が"ならば、奇数番目、頭が"じゃなければ、偶数番目にかこまれているやつはくる str1 = str1.split("\"") str2 = str2.split("\"")...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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; ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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 &...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import re def solve(s, t): if s == t: return "IDENTICAL" s = s.split("\"") t = t.split("\"") if len(s) == len(t): a = sum(s[i] != t[i] for i in range(0, len(s), 2)) b = sum(s[i] != t[i] for i in range(1, len(s), 2)) if a == 0 and b == 1: return "CLOSE" return "DIFFERENT" while True: s = input() if s...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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] != '"')...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while 1: s1 = input().split('"') l1 = len(s1) if s1[0] == ".": break s2 = input().split('"') l2 = len(s2) if l1 != l2: print("DIFFERENT") continue i = 0 cnt = 0 while 1: if s1[i] != s2[i]: print("DIFFERENT") break if i > l1-2: ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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; ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while 1: a = input() if a == ".": break b = input() if a == b: print("IDENTICAL") else: a = a.split("\"") b = b.split("\"") if len(a) != len(b): print("DIFFERENT") else: key = [0,0] for i in range(len(a)): ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while 1: s1 = input().split('\"') if s1[0] == '.': break s2 = input().split('\"') jdg = 1 cnt_d = 0 #print(s1) #print(s2) if len(s1) != len(s2): print("DIFFERENT") else: l = len(s1) i = 0 while i < l: if s1[i] != s2[i]: cnt_d += 1...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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++){ ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
s=[] while 1: l1=input() if l1==".": break l2=input() sp1=l1.split('"') sp2=l2.split('"') t=0 if len(sp1)==len(sp2): for i in range(len(sp1)): if i%2==1 and sp1[i]!=sp2[i]: t+=1 elif i%2!=1 and sp1[i]!=sp2[i]: t+=...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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_...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
def solve(s1,s2): if s1 == s2: return 0 l1,l2 = s1.split('"'),s2.split('"') if len(l1) != len(l2): return 1 ct = 0 for i in range(len(l1)): if i%2 == 0: if l1[i] != l2[i]: return 1 else: if l1[i] != l2[i]: ct +...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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){ ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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] == '.') ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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); ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); loop: while (true) { String s1 = sc.next(); if (s1.equals(".")) return; String s2 = sc.next(); if (s1.equals(s2)) { System.out.println("IDENTICAL"); continue; } ...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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)...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] arg){ Main m = new Main(); m.run(); } String I = "IDENTICAL"; String C = "CLOSE"; String D = "DIFFERENT"; void run(){ for(;;) { String s...
JAVA
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
while True: s1 = input().split('"') if s1[0] == '.': exit() s2 = input().split('"') if len(s1) != len(s2): print('DIFFERENT') continue ans = 1 for i in range(len(s1)): if i % 2 == 0: if s1[i] != s2[i]: ans = -1 else: ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
# from sys import exit while(True): S0 = str(input()) if S0 == ".": exit() S1 = str(input()) if S0 == S1: print("IDENTICAL") continue S0else = list(S0.split('"')[0::2]) S1else = list(S1.split('"')[0::2]) if S0else != S1else: print("DIFFERENT") continu...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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 ...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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 =...
CPP
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
ans_list = [] def solve(): S = input() if S == ".": return "end" T = input() if S == T: return "IDENTICAL" cs = [] ct = [] ns = [] nt = [] tmp = "" flag = False for s in S: if s == '"': if flag: flag = False ...
PYTHON3
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
def solve(s, t): s = s.split('"') t = t.split('"') if s == t: return "IDENTICAL" if len(s) == len(t): cnt = 0 for i in range(len(s)): if s[i] != t[i] and i % 2 == 1: cnt += 1 elif s[i] != t[i]: cnt += 2 if cnt == 1...
PYTHON
p01102 Almost Identical Programs
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 correct solution. Each of the submissions should include the pr...
7
0
#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++;...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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,...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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 ...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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 ...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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);...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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 ...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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]-...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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,...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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...
CPP
p01239 Connect Line Segments
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 segments. The objective is to form a single polyline, by conne...
7
0
#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);...
CPP