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
p00970 Emergency Evacuation
Emergency Evacuation The Japanese government plans to increase the number of inbound tourists to forty million in the year 2020, and sixty million in 2030. Not only increasing touristic appeal but also developing tourism infrastructure further is indispensable to accomplish such numbers. One possible enhancement on t...
7
0
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<int, ll> pil; typedef pair<int, ll> pli; typedef pair<double,double> pdd; #define SQ(i) ((i)*(i)) #define MEM(a, b) memset(a, (b), sizeof(a)) #define SZ(i) int(i.size()) #define FOR(i, ...
CPP
p00970 Emergency Evacuation
Emergency Evacuation The Japanese government plans to increase the number of inbound tourists to forty million in the year 2020, and sixty million in 2030. Not only increasing touristic appeal but also developing tourism infrastructure further is indispensable to accomplish such numbers. One possible enhancement on t...
7
0
#include <iostream> #include <map> #include <cmath> using namespace std; int r, s, p; int main() { while (cin >> r >> s >> p) { map<int, int> cnt; for (int i = 0; i < p; ++i) { int x, y; cin >> y >> x; int xx; if (x > s) { xx = x - s; } else { xx = s - x + 1; ...
CPP
p00970 Emergency Evacuation
Emergency Evacuation The Japanese government plans to increase the number of inbound tourists to forty million in the year 2020, and sixty million in 2030. Not only increasing touristic appeal but also developing tourism infrastructure further is indispensable to accomplish such numbers. One possible enhancement on t...
7
0
// // Created by maze on 2019/11/03. // #include <bits/stdc++.h> using namespace std; #define INF_LL (int64)le18 #define INF (int32)le9 #define REP(i, n) for(int64 i = 0; i < (n); i++) #define FOR(i, a, b) for(int64 i = (a); i < (b); i++) #define all(x) x.begin(), x.end() #define fs first #define sc second using int...
CPP
p00970 Emergency Evacuation
Emergency Evacuation The Japanese government plans to increase the number of inbound tourists to forty million in the year 2020, and sixty million in 2030. Not only increasing touristic appeal but also developing tourism infrastructure further is indispensable to accomplish such numbers. One possible enhancement on t...
7
0
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second #define pii pair<int, int> #define eb emplace_back #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep3(i, l, n) for (int i = l; i < (n); ++i) #define sz(v) (int)v.size() #define...
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 <vector> #include <string> using namespace std; string s; string tt; int ans; int ff,fff; int main(){ cin >> s; while(s!="."){ ans=0; ff=0; fff=0; int i=0; int j=0; cin >> tt; for(;i<int(s.size())&&j<int(tt.size());){ if(s[i]==tt[j]...
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 main(s): if s == ".": return False ss = input() diffc = 0 sl = s.split("\"") ssl = ss.split("\"") if len(sl) != len(ssl): print("DIFFERENT") return True for i in range(len(sl)): if i % 2 == 0: if sl[i] != ssl[i]: print("DIFFERENT") return True else: if sl[i] != ssl[i]: diffc += 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; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair<int, int> P; typedef pair<int, P> E; #define MOD (1000000007ll) #define l_ength size void mul_mod(ll& a, ll b){ a *= b; a %= MOD; } void add_mod(ll& a, ll b){ b += MOD; a += b; a %= 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
#include <bits/stdc++.h> using namespace std; using ll = long long; using PII = pair<ll, ll>; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() template<typename T> void chmin(T &a, const T &b) { a = min(a, b); } template<typename T> void chmax(T &a...
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; string s, t; string solve(); int main() { while(1) { cin >> s; if(s == ".") break; cin >> t; cout << solve() << endl; } return 0; } string solve() { if(s == t) return "IDENTICAL"; int si = 0, ti = 0, cnt = 0; while(si < s.size() && ti < t.siz...
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 <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <cstring> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <list> #include <algorithm> #include <functio...
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; using lint = long long; template<class T = int> using V = vector<T>; template<class T = int> using VV = V< V<T> >; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); while (true) { string s; cin >> s; if (s == ".") break; string t; cin >> t; au...
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() ans = None if s1 == s2: ans = 'IDENTICAL' if ans is None: s1 = s1.split('"') s2 = s2.split('"') if len(s1) == len(s2): miss = 0 for p1, p2 in zip(s1[0::2], s2[0::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; #define int long long signed main(){ string s,t; while(cin>>s,s!="."){ cin>>t; if(s==t){ cout<<"IDENTICAL"<<endl; continue; } string u,v; int n=s.size(),m=t.size(); vector<string> vs,vt; for(int i=0;i<n;i++){ if(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
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] s = new String[2]; while(true) { s[0] = scan.next(); if(s[0].equals(".")) {break;} s[1] = scan.next(); Li...
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
def f(S): S_not_in_q = [] S_in_q = [] tmp = '' i = 0 while i < len(S): if S[i] == '"': if tmp != '': S_not_in_q.append(tmp) tmp = '' i += 1 while S[i] != '"': tmp += S[i] i += 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> using namespace std; int main(){ while(1){ string s1,s2; cin >> s1; if(s1==".")break; cin >> s2; if(s1==s2){ cout << "IDENTICAL" << endl; continue; } string t1,t2; t1 = s1;t2 = s2; while(1){ size_t d1b = t1.find('\"'); if(d1b==string::npos)break; t1.replace(d1b,1...
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 <stdlib.h> #include<limits.h> int check2(char *a, char *b, int *i, int *j) { int now = 0; for(; *i < 200 && *j < 200;) { //printf("A %c %c %d %d %d\n", a[*i], b[*j], a[*i] != b[*j], *i, *j); if(a[*i] != b[*j]) now = 1; if(a[*i] == '"' && b[*j] == '"') ...
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 int long long signed main() { cin.tie(0); ios_base::sync_with_stdio(0); cout << fixed << setprecision(12); string s1; while ( cin >> s1, s1 != "." ) { string s2; cin >> s2; vector<string> t1, t2; { string s = ""; for ( int 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
// ?????????.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include <iostream> #include <string> using namespace std; int main() { while (true) { string s1; string s2; cin >> s1; if (s1 == ".") break; cin >> s2; if (s1 == s2) { cout << "IDENTIC...
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; int main(void){ int n,m; while(true){ string s1, s2; cin >> s1; if(s1 == ".")break; cin >> s2; if(s1 == s2){ cout << "IDENTICAL" << endl; continue; } int close = 0; bool quo = false; int i = 0, j = 0; while(true){ if(i==s1.size() || j == s2....
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 <cmath> #include <utility> #include <functional> #include <math.h> #include <algorithm> #include <iomanip> #include <vector> #include <string> #include <set> #include <map> #include <tuple> #include <stdlib.h> #include <deque> using namespace std; #define rep(i,n,x) for(int i=n;i<x;i++) #de...
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 s, t, ans; vector<string> sl, tl; cin >> s; if (s == ".")break; cin >> t; if (s.size() < t.size()) { string a; a = s; s = t; t = a; } string a=""; 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 <bits/stdc++.h> using namespace std; #define rep(i,n) REP(i,0,n) #define REP(i,s,e) for(int i=(s); i<(int)(e); i++) #define pb push_back #define all(r) r.begin(),r.end() #define rall(r) r.rbegin(),r.rend() #define fi first #define se second typedef long long ll; typedef vector<int> vi; typedef vector<...
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
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count1=0 count2=0 if len(a) != len(b): results.append(2) else: for i in range(len(a)): if(i%2==1): if len(a[i]) != len(b[i]): count1+...
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> #include<vector> using namespace std; typedef long long ll; string s1, s2; int main() { while (1) { cin >> s1; if (s1[0] == '.') break; cin >> s2; vector<string> d1, d2; if (s1 == s2) { cout << "IDENTICAL" << endl; continue; ...
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 == ".") { break; } string s2; cin >> s2; if (s1 == s2) { cout << "IDENTICAL" << endl; continue; } string t1 = s1; string t2 = s2; while (true) { size_t d1b = t1....
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 s1[305], s2[305]; int len1, len2, tp1, tp2; int main(){ while(1){ // puts("INN"); scanf("%s",s1); if(s1[0]=='.')break; scanf("%s",s2); len1 = strlen(s1); len2 = strlen(s2); if(len1 == len2){ 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 "bits/stdc++.h" #define REP(i, n ,N) for(ll i = (n); i < (N); i++) #define p(s) cout<<(s)<<endl #define p2(a, b) cout<<(a)<<" "<<(b)<<endl using namespace std; typedef long long ll; ll MOD = 1e9+7; ll inf = 1e18; string s1, s2; vector<string> split_string(string s, char c){ vector<string> s_vec; ll pre = ...
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 ll long long int main(){ while(true){ string a,b; ll flaga=0,flagb=0,flagc=0; cin >> a; if(a == "."){ return 0; } cin >> b; long unsigned int i=0,j=0; while(i != a.length() && j != b.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('"') if s1[0]==".": break s2=input().split('"') cnt1=0 cnt2=0 flag=0 if len(s1)!=len(s2): print("DIFFERENT") else: i=0 while i<len(s1): if s1[i]==s2[i]: cnt1+=1 elif i%2==0: print("DIFFERENT") flag=1 break else: cnt2+=1 if cnt2>1: 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 <bits/stdc++.h> #define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++) #define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--) #define sz(v) (int)(v).size() #define pb push_back #define sc second #define fr first #define sor(v) sort(v.begin(),v.end()) #define rev(s) reverse(s.begin(),s.end()) #define lb(ve...
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,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) int main() { for (string s1, s2; cin >> s1&&s1 != ".";) { cin >> s2; vector<string> a1, a2; string b1, b2; // " ?????? { bool l = false; string tmp = ""; rep(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<list> #include<vector> using namespace std; int main(){ string s1,s2; while(true){ cin>>s1; if(s1==".")break; cin>>s2; vector<string>p1,p2;//program 1,program2 vector<string>t1,t2;//text1 text2 bool flag=false;//f ???????????? !f ????????°?????? 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 <bits/stdc++.h> //#include <stdio.h> #include<iostream> #include<cstdio> #include<bitset> #include<algorithm> #include<vector> #include<list> #include<queue> #include<stack> #include<string> #include<string.h> #include<cmath> #include<utility> #include<functional> #include<map> #include<set> #include<cctype>...
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 ll long long #define rep(i,n) for(ll (i)=0;(i)<(n);(i)++) using namespace std; int main(){ while(true){ string str[2]; cin>>str[0]; if(str[0]==".")return 0; cin>>str[1]; bool flag=false; vector<vector<ll>> mozi(2,vector<ll>()); ...
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
// 2017/12/11 Tazoe #include <iostream> #include <string> using namespace std; int main() { while(true){ string s1; cin >> s1; if(s1==".") break; string s2; cin >> s2; if(s1==s2){ cout << "IDENTICAL" << endl; continue; } string t1 = s1; string t2 = s2; while(true){ size_t d1b = 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
A=[] while True: a=input().split('"') if a[0]==".": break b=input().split('"') cnt=0 if len(a)!=len(b): A.append(-1) else: for i in range(len(a)): if(a[i]==b[i]): pass else: if i%2==1: cnt+=1 else: cnt+=2 if cnt>=2: A.append(-1) if cnt==1: A.append(0) if cnt==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<string> using namespace std; int main() { while (true) { char s1[200], s2[200]; cin >> s1; if (s1[0] == '.' && s1[1] == '\0') { break; } cin >> s2; bool isClose = false, isDifferent = false; bool isInsideBlock = false; int s1Offset = 0, s2Offset = 0; for (int i = 0; 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 <algorithm> #include <iomanip> #include <map> #include <set> #include <queue> #include <stack> #include <numeric> #include <bitset> #include <cmath> static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template<class T> constexpr T INF = ::nu...
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 s){ bool isConstString = false; string tmp = ""; vector<pair<string,bool>> res; for(int i = 0;i < s.size();i++){ if(s[i] == '\"'){ res.push_back(make_pair(tmp,isConstString)); tmp = ""; ...
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==".") break; string s2; cin >> s2; if(s1==s2){ cout << "IDENTICAL" << endl; continue; } 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
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> #define ll long long using namespace std; bool check(string s1, string s2) { int l1 = 0, l2 = 0, diff = 0; while (l1 < s1.size() || l2 < s2.size()) { if (l1 == s1.size() || l2 == s2.size()) return false; if (s1[l1] != s2[l2]) return false; if (s1[l1] == '"') { ...
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: s = input().split('"') if s == ['.']: exit() t = input().split('"') is_diff = False is_close = 0 if len(s) == len(t): for i in range(len(s)): if i % 2 == 0: if s[i] != t[i]: is_diff = True 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
def solve(s,t): if s==t: return 'IDENTICAL' s=s.split('"') t=t.split('"') if len(s)==len(t): k0=sum(s[i]!=t[i] for i in range(0,len(s),2)) k1=sum(s[i]!=t[i] for i in range(1,len(s),2)) if k0==0 and k1==1: return 'CLOSE' return 'DIFFERENT' while True: s=input() if s=='.': break t=input() 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 <stdio.h> #include <string.h> int main(void) { char str1[201], str2[201]; bool flag; int i, j, count; while(1) { scanf("%s", str1); if(str1[0] == '.' && str1[1] == '\0') break; scanf("%s", str2); if(strcmp(str1, str2) == 0){ printf("IDENTICAL\n"); continue; } flag = false; i = j = c...
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.*; import java.io.BufferedReader; public class Main{ public static String replaceS(String s, int begin, int end){ String newString = s.substring(0,begin) + s.substring(end); return newString; } public static void main(String[] args){ String s1,s2; //final Str...
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
st = [] while(1): a1 = input() if a1 =='.': break a2 = input() b1 = a1.split('"') b2 = a2.split('"') cnt = 0 if len(b1)==len(b2): for i in range(0,len(b1)): if i%2==0: if b1[i]!=b2[i]: cnt+=10000 break ...
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(1){ string s1; cin>>s1; if(s1==".") break; string s2; cin>>s2; if(s1==s2){ cout<<"IDENTICAL"<<endl; continue; } string t1=s1; string t2=s2; while (1) { size_t d1b=t1.find('\"'); if(d1b==string::npos) br...
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: data = input() if data == ".": break inqrt1 = [] outqrt1 = [] nowqrt = False stringin = "" stringout = "" count = 0 for char in data: if nowqrt: if char != '"' and count != len(data) - 1: stringin += char 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() w1 = s1.split('"') w2 = s2.split('"') if len(w1) != len(w2): result = "DIFFERENT" else: n = len(w1) result = "IDENTICAL" for i in range(n): if i % 2 == 0: if w1[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 <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits> #include <cfloat>...
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; 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
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; while (cin >> s1, s1 != ".") { cin >> s2; if (s1 == s2) { puts("IDENTICAL"); continue; } int n1 = s1.size(), n2 = s2.size(); bool ok = true; int i1 = 0, i2 = 0, cnt = 0; while (i1 < n1 || i2 < n2) { string t1, t2; whi...
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<bool,string> P; vector<P> parse(string s) { vector<P> ret; int i=0; while(i<s.size()) { if(s[i]=='\"') { string tmp; i++; while(s[i]!='\"') { tmp+=s[i]; i++; } ret.push_back(P(true,tmp)); i++; }else{ string tmp; wh...
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
#!/usr/bin/python import sys if sys.version_info[0]>=3: raw_input=input def solve(s,t): if s==t: return 'IDENTICAL' s=s.split('"') t=t.split('"') if len(s)==len(t): k0=sum(s[i]!=t[i] for i in range(0,len(s),2)) k1=sum(s[i]!=t[i] for i in range(1,len(s),2)) if k0==0 and k1==1: return 'CLOSE' return 'DIF...
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
import java.util.ArrayList; import java.util.Scanner; /** * Kadai */ public class Main { public void go() { Scanner sc = new Scanner(System.in); while (sc.hasNextLine()) { String lines0; String lines1; lines0 = sc.nextLine(); if (lines0.equals(".")...
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; 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.size())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<iostream> #include<cstdio> #include<vector> #define REP(i,s,n) for(int i=s;i<n;++i) #define rep(i,n) REP(i,0,n) using namespace std; const string Y = "IDENTICAL"; const string N = "DIFFERENT"; const string C = "CLOSE"; string elim(string s) { string ret = ""; bool toggle = false; rep(i,(int)s.size())...
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: 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<iostream> #include<string> #include<vector> using namespace std; void split(string s, vector<string> &v) { s += '"'; string buf = ""; for (int i = 0; i < s.size(); i++) { if (s[i] == '"') { v.push_back(buf); buf = ""; } else buf += s[i]; } } int main() { while (1) { string S1, S2; 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
def vals(arr): even = True res = [[], []] tmp = [] for e in arr: if e == "\"": even = not even res[even].append(tmp) tmp = [] continue tmp.append(e) even = not even res[even].append(tmp) return res while True: str1 = input...
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<string> #include<iostream> #include<vector> using namespace std; vector<string> split(const string& s, char delim) { int left = 0; auto v = vector<string>(); for (int i = 0; i < s.size(); ++i) { if (s[i] == delim) { v.push_back(s.substr(left, i - left)); left = 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> #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; #define rep(i, n) for(int i = 0; i < n; ++i) #define rep2(i, a, b) for(int i = (a); i <= (b); ++i) #define ll long long int main() { while(1) { string s; 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 <string> #include <vector> using namespace std; int main() { string s1, s2; while (cin >> s1) { if (s1 == ".") { break; } cin >> s2; if (s1 == s2) { cout << "IDENTICAL" << endl; } else { int s1c = 0; vector<string> s11; string subs1 = ""; string kk = ""; ...
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 parse(str): strs = [] s = "" code = "" isStr = False for c in str: if c == "\"": if isStr: strs.append(s) s = "" else: code = code + c isStr = not isStr elif isStr: s = s + c e...
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 sys import re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2,gcd from itertools import permutations, combinations, product from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_upper...
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
s1 = input().split('"') while s1[0]!='.': miss = 0 ans = "IDENTICAL" s2 = input().split('"') if len(s1) != len(s2): ans="DIFFERENT" else : for i in range(len(s1)): if i % 2 == 0 and s1[i] != s2[i]: ans="DIFFERENT" break if i % 2 == 1 and s1[i] != s2[i]: if ans == "C...
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(){ while (1){ string s1; cin >> s1; if (s1 == "."){ break; } string s2; cin >> s2; if (s1 == s2){ cout << "IDENTICAL" << endl; } else { int N = s1.size(); vector<string> A(1); for (int i = 0; i < N; 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; int main() { while(1){ string s1,s2; cin >> s1; if(s1[0] == '.' && s1.size() == 1){ break; } cin >> s2; string::iterator itr1 = s1.begin(),itr2 = s2.begin(); bool firstdiff = false; boo...
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; int foo(vector<string> s[], vector<string> t[]){ if(s[0].size() != t[0].size() || s[1].size() != t[1].size())return false; // cout<<s[0].size()<<" "<<t[0].size()<<" "<<s[1].size()<<" "<<t[1].size()<<endl; for(int i = 0; i < s[0].size(); i++){ if(s[0][i] != t[0][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: 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 # print(s1,s2) while 1: if s1[i] != s2[i]: print("DIFFERENT") break ...
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<cmath> #include<algorithm> #include<utility> #include<map> #include<set> #include<string> using namespace std; #define ll long long bool check(string s1,string s2){ int l = 0, r = 0; bool flag = false; int cnt = 0; while(l < s1.size() || r < s2.size()){ ...
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<cstring> using namespace std; char ca[2][205]; void print(int n){ if(n<0)cout<<"DIFFERENT"<<endl; if(n==0)cout<<"CLOSE"<<endl; if(n>0)cout<<"IDENTICAL"<<endl; } bool check(int a,int b){ if(a>=strlen(ca[0]) && b>=strlen(ca[1]))return true; if(a>=strlen(ca[0]) || b>=strlen(ca[1]))return...
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; using ll = int64_t; template <typename T> using V = vector<T>; using VS = vector<string>; pair<VS, VS> parse(const string &S) { VS num, str; bool in_quot = false; bool init = true; string now = ""; for(char c : S) { if(c == ';' && !in_quot) { ...
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 <cstdio> #include <algorithm> #include <cstring> using namespace std; int main() { int k,l,la,lb,ans,stat,poi; char a[205],b[205]; scanf("%s",a);//getchar(); while(a[0]!='.' || a[1]!='\0') { scanf("%s",b);//getchar(); ans=stat=k=l=poi=0; la=strl...
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 <algorithm> #include <string> using namespace std; string s1, s2; int main() { while (1) { int count = 0; int n1 = 0; int n2 = 0; int error = 0; cin >> s1; if(s1 == ".") break; cin >> s2; if(s1 == s2) { cout << "IDENTICAL" << endl; continue;...
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<cstdio> #include<string> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> using namespace std; typedef long long ll; const ll MOD = 998244353; const ll ...
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 rep(i,j,k) for(int i=(int)j;i<(int)k;i++) #define itrep(x) for(auto it=(x).begin();it!=(x).end();it++) #define Sort(x) sort((x).begin(),(x).end()) #define all(x) (x).begin(),(x).end() #define fi first #define se second #define vi vector<int> #define INF (int)1e9 #define INFL 1e18 #defi...
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<algorithm> using namespace std; int main(){ while(true){ string s1,s2; cin >> s1; if(s1[0]=='.')break; cin >> s2; int count=2; for(int i=0,j=0;true;i++,j++){ if(s1[i]!=s2[j]){//そもそも違うコードだったら count=0; break; } if(s1[i]=='\0'||s2[j]...
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<cstdio> #include<cstring> #include<string.h> using namespace std; char s1[205],s2[205]; bool mark; int w,ww,i,j; int main() { while(1) { w=0; mark=0; scanf("%s",s1); if(s1[0]=='.') break; scanf("%s",s2); int l=strlen(s1),len=strlen(s2); for(i=0,j=0;i<l&&j<len;j++,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<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<string> #include<algorithm> #include<vector> #include<queue> #include<set> #include<map> #include<stack> #define MOD 10000000 using namespace std; typedef long long LL; long long quickpow(long long n, long long base) { ...
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 <algorithm> #include <vector> #include <string> #define int long long using namespace std; signed main() { string s, t; while (cin >> s && s != ".") { cin >> t; string s_a[234], t_a[234]; int i = 0, s_l = 0, t_l = 0; for (i = 0; i < s.size(); i++) { while (i < s.size() && 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; int main(){ string s1,s2; bool t = false; while(1){ int cnt = 0; cin>>s1; if(s1==".") break; cin>>s2; if(s1==s2){ cout<<"IDENTICAL"<<endl; continue; } else{ int i=0; int j=0; t = false; while(1){ if(s1[i]=='\0' && s2[j]=='\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 <algorithm> #include <iostream> #include <vector> using namespace std; void hoge(string s, string &new_s, vector<string> &vs) { bool in_quote = false; string sub_s = ""; for (char c: s) { if (in_quote) { if (c == '"') { vs.emplace_back(sub_s); sub_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; using ll = long long; vector<string> split(string s) { vector<string> ret; int bef = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == '"') { ret.push_back(s.substr(bef, i - bef + 1)); bef = i + 1; } } if (bef < s.size()) ret.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
#include <bits/stdc++.h> using namespace std; vector<string> make(string s) { vector<string> v{""}; for(char c:s) { if(c=='\"') { v.push_back(""); } else { v.back()+=c; } } return v; } const string dif="DIFFERENT",ide="IDENTIC...
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.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); String s = in.nextLine(); while ...
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(){ while(1){ string s1,s2; cin>>s1>>s2; if(s1=="."){ break; } if(s1==s2){ cout<<"IDENTICAL"<<endl; continue; } string t1=s1; string t2=s2; while(1){ size_t d1b=t1.find('\"'); if(d1b==string::npos){ break...
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 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s1; String s2; w: while (true) { s1 = sc.next(); if (".".equals(s1)) { break; } 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
ans=[] while 1: s1=input().split('"') if s1[0]==".": break s2=input().split('"') if len(s1)!=len(s2): ans.append("DIFFERENT") continue else: cnt=0 flag=0 for i in range(len(s1)): if s1[i]!=s2[i]: if i==0: flag=1 break elif i%2==0: flag=1 break el...
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> using namespace std; string exec(vector<string> &v, string s){ string ret = ""; for(int i = 0; i < s.length(); i++){ if(s[i] == '"'){ i++; string tmp = ""; while(i < s.length() && s[i] != '"') tmp += s[i], i++; v.push_...
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<cstdio> #include<iostream> #include<cstring> #include<cmath> using namespace std; char s1[205],s2[205]; int main() { for(;;) { scanf("%s",s1); if(s1[0]=='.')break; scanf("%s",s2); int len1=strlen(s1); int len2=strlen(s2); int t1=0,t2=0; for(int 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; using ll=long long; using ull=unsigned long long; using pii=pair<int,int>; #define INF LONG_MAX #define MOD 1000000007 #define rng(a) a.begin(),a.end() #define rrng(a) a.end(),a.begin() int main(){ ios::sync_with_stdio(false); cin.tie(0); while(true){ string ...
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<algorithm> #include<numeric> #include<vector> #include <string> using namespace std; void split(string s, vector<string> &v){ v.clear(); s +='"'; string str=""; for(int i=0;i<s.size();i++){ if(s[i]=='"'){ v.push_back(str); 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<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<cctype> #include<math.h> #include<string> #include<string.h> #include<stack> #include<queue> #include<vector> #include<utility> #include<set> #include<map> #include<stdlib.h> #include<iomanip> using namespace std; #define ll long long #d...
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 { static final String IDENTICAL = "IDENTICAL"; static final String CLOSE = "CLOSE"; static final String DIFFERENT = "DIFFERENT"; public static void main(String[] args) { Scanner in = new Scanner(System.in); while (true) { String s1 = in.next(); if (s1.equals...
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 s1, s2; while (cin >> s1, s1 != ".") { cin >> s2; if (s1 == s2) { cout << "IDENTICAL" << endl; continue; } bool quote = false, flag = true; int mcnt = 0, i = 0, j = 0; while (i < s1.size () && j < s2.size ()) { 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: #strings1 = [] #strings2 = [] k1 = [] g1 = [] k2 = [] g2 = [] check=input() if check == ".": break strings1 = list(map(str, check.split('"'))) strings2 = list(map(str, input().split('"'))) nagasa1 = len(strings1) nagasa2 = len(strings2) for 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<bits/stdc++.h> #define INF 1e9 #define llINF 1e18 #define MOD 1000000007 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long #define ull unsigned long long #define vi vector<ll> #define vvi vector<vi> #define DBG_N(hoge) cerr<<" "<<(hoge)<<endl; #define DBG cerr<<"!...
CPP