uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
d8172ecb-0177-4a11-bdb2-8efe01945702
sneh-d/Language_Translator
src/ccmain/osdetect.cpp
#include "osdetect.h" #include "blobbox.h" #include "blread.h" #include "colfind.h" #include "fontinfo.h" #include "imagefind.h" #include "linefind.h" #include "oldlist.h" #include "qrsequence.h" #include "ratngs.h" #include "strngs.h" #include "tabvector.h" #include "tesseractclass.h" #include "textord.h" #include <...
ALGO
0.861401
6.643177
cb14b120-f4f3-4cc0-b4e8-48ab666b287f
a-wolk/RegexEngine-NFA
Regex.cpp
#include "Regex.hpp" Regex::Regex(const std::string& regex){ auto root = RegexParser::parse(regex); nfa = RegexCompiler::compile(root); } /** * Walk through states using epsilon transitions. * If state has non-epsilon transitions it can be used in next step so return it. * When we get to accepting state re...
ALGO
0.899568
4.525665
f22f4484-ae6d-4e42-ba18-dfc1cbca9da3
UHeeJoon/C-study2
BaekJoon/23827번.cpp
#include<bits/stdc++.h> using namespace std; const int MOD = 1000000007; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long n, sum(0), result(0); cin >> n; long long tmp, tmp2; cin >> tmp >> tmp2; sum = (tmp + tmp2) % MOD; result = ((tmp % MOD) * (tmp2 % MOD)) % MOD; n -= 2; ...
ALGO
0.999981
4.068624
d03b0701-6bf4-4ae7-8650-b0a3c6c36741
rekhav55/LeetcodeSolutions
1008-construct-binary-search-tree-from-preorder-traversal/1008-construct-binary-search-tree-from-preorder-traversal.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999983
6.240173
c603694d-db69-4b13-adcf-be497d12eb6c
miiitomi/atcoder
ABC/abc376/b.cpp
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; const ll INF = 2e+18; const ll MOD = 998244353; void solve() { ll N, Q; cin >> N >> Q; ll left = 0, right = 1, cnt = 0; while (Q--) { char c; ...
ALGO
0.999707
4.526449
8b0e41eb-6994-4024-a35b-60638bdbe80a
Rohith-Rao/DSA-codes
mids/mid_q2.cpp
#include <iostream> using namespace std; struct lnode { int data; lnode *next; }; typedef struct lnode *lptr; struct bstnode { lptr l; bstnode *lchild; bstnode *rchild; }; typedef struct bstnode *bstptr; void addend(lptr &p,int n) { lptr T; T=new(node); T->data=n; T->next=NULL; if(p==NULL) { p=T; ...
ALGO
0.999976
3.730002
36fe8d1a-e100-41e6-9b17-7197aaa8c232
TisyaManhas/SPPU-FDS-SE-Assignments
Assignment9.cpp
#include <bits/stdc++.h> using namespace std; class node { public: int prn; string name; node *next; public: node() { cout << "Node Initialized" << endl; next = NULL; } node(int n, string s) { this->prn = n; this->name = s; next = NULL; } ~node...
ALGO
0.993598
4.656487
68c7ddea-e906-4ccd-bd6a-46a2b245cb14
sanik4144/codeforces
271A.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int y; cin>>y; while(1){ y++; int x=y; int p=x/1000; x=x%1000; int q=x/100; x=x%100; int r=x/10; int s=x%10; if(p!=q && p!=r && p!=s && q!=r && q!=s && r!=s) break; } ...
ALGO
0.992121
3.157858
505247fb-437b-4a89-b105-a461d2a25637
Divyamsirswal/CPP-DSA-PRACTICE
Recursion/basic_problems.cpp
//1.print name n time. // #include<bits/stdc++.h> // using namespace std; // void f(int i,int n){ // if(i>n) return; // cout<<"Divyam"<<"\n"; // f(i+1,n); // } // int main(){ // int n; // cin >> n; // f(1,n); // return 0; // } //2. print 1 to n linearlly. // #include<bits/s...
ALGO
0.999674
3.85326
9de28201-2abd-4f73-9147-5b0128a25d3c
BangKartavya/LeetCode
Maximum Matching of Players With Trainers/main.cpp
class Solution { public: int matchPlayersAndTrainers(vector<int>& players, vector<int>& trainers) { sort(begin(players),end(players)); sort(begin(trainers),end(trainers)); int n = players.size(); int m = trainers.size(); int i = 0; int j = 0; int count = 0; ...
ALGO
0.999707
5.604435
ca57effe-b1e5-41af-a585-f51eb2ea3e2a
kocherzhenko/Quantum
Complex.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include "Initialize.h" #define PI 3.14159265358 #define EXP 2.7182818285 /* -------------------------------------- Complex number operations ---------------------------------------*/ // Convert real and imaginary parts of complex number to amplitude a...
ALGO
0.997858
3.248367
f282fc48-77e1-477b-9673-44c8d8f39aff
drewlum/Learning
CPP/examples/change_example/change.cpp
#include <iostream> #include <cassert> double make_change(double dollars){ std::cout << "dollars: " << dollars << std::endl; double pennies = 100 * dollars; std::cout << "pennies: " << pennies << std::endl; int denoms[4] = {25,10,5,1}; double counts[4] = {0}; for (int i=0; i <4; ++i){ s...
ALGO
0.943445
4.899291
0f2574c6-1069-48a3-ba0d-d6c3fddb0d79
liaoyaonline/LeetCodeNote
算法模板/通用/仿LISP运算/main.cpp
/*pow(16,i),queue.front()struct Tree{};vector<string> res(8, "");mp.find(key) == * mp.end() int a[5] = {},vector<int> num(a,a+..) set test; test.insert(1),auto * it = test.begin() bool cmp(const word &num1, const word &num2) { return num1.value != num2.value ? num1.value > num2.value: num1.name < num2.name;} v.ins...
ALGO
0.999909
4.48946
3ee20ab0-262c-4070-a14c-398c5519de94
proteneer/terran
tests/testMethodsPeriodicGaussian.cpp
#include <MethodsPeriodicGaussian.h> #include <vector> #include <iostream> #include <stdexcept> #include "util.h" using namespace std; using namespace Terran; #include <fstream> void testFindPeriodicMaxima() { const double tol = 1e-2; int testCount = 0; const double period = 2*PI; // Bimodal ...
ALGO
0.999371
5.802427
25c27c92-707c-4196-afd5-e94d073d2dfe
ichigo100percent/KKK_Jongsang
C++_04/C++_04.cpp
#include "QuadTree.h" std::vector<Object*> StaticObjectList; std::vector<Object*> DynamicObjectList; void SetStaticObject(QuadTree& quadtree) { for (int i = 0; i < 3; i++) { Object* obj = new StaticObject(); obj->m_csName = L"StaticObj"; obj->m_csName += std::to_wstring(i); obj->m_Position = { (float)(rand(...
TOOL
0.91448
4.389489
cca9a921-77e1-4bdc-abb1-aeb4b61dab3b
AnshulChaturvedi/Anshul-Codes
0146-lru-cache/0146-lru-cache.cpp
class LRUCache { public: list<int> dll; map<int,pair<list<int>::iterator,int>> mpp; int n; LRUCache(int capacity) { n = capacity; } void makeRecent(int key){ dll.erase(mpp[key].first); dll.push_front(key); mpp[key].first = dll.begin(); return; } ...
ALGO
0.99946
6.227858
730746cb-d584-43dc-a822-98b8d37889ab
AdityaHegde02/Leetcode-Solved
0058-length-of-last-word/0058-length-of-last-word.cpp
class Solution { public: int lengthOfLastWord(string s) { int n = s.size(); int i = n - 1; while(i>=0 and s[i] == ' '){ i--; } int size = 0; while(i>=0 and s[i]!=' '){ i--; size++; } return...
ALGO
0.999568
5.66759
7380ebbc-6b28-41fb-838f-72208028d189
Jlassi-Mohamed/Competitive-Programming-Solutions
LeetCode/Backtacking/77. Combinations.cpp
class Solution { public: void solve(int& n, int& k, vector<vector<int>>& res, vector<int> v, int curr) { if(v.size() == k) { res.push_back(v); return ; } for(int i=curr; i<=n; i++) { v.push_back(i); solve(n, k, res, v, ...
ALGO
0.999993
5.850269
97e3c836-7abc-4ee0-869f-89e710a05414
htzs2050/ojplus-frontend
hello-algo/codes/cpp/chapter_dynamic_programming/min_path_sum.cpp
/** * File: min_path_sum.cpp * Created Time: 2023-07-10 * Author: krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 最小路径和:暴力搜索 */ int minPathSumDFS(vector<vector<int>> &grid, int i, int j) { // 若为左上角单元格,则终止搜索 if (i == 0 && j == 0) { return grid[0][0]; } // 若行列索引越界,则返回 +∞ 代价 if (i ...
ALGO
0.999971
5.770255
e189983b-bf35-41d1-bad6-3a0786a13c0d
iagorrr/Competitive-Programming-Solutions
submissions/Neps/notas.cpp
// https://www.beecrowd.com.br/judge/pt/problems/view/2469 #include <bits/stdc++.h> #define vll vector <long long int> #define lli long long int #define ulli unsigned long long int #define vbool vector <bool> #define LOOP(I, S, E) for(lli I = S; I < E; I++) #define LOOPIN(i, E, V) for(lli i = 0; i < E; i++){cin >> V...
ALGO
0.999885
4.517197
42f453dd-6532-4fef-b0c2-3479dfa53e10
hicardhiroshi/Programacao-Competitiva
Assiut University Training - Newcomers (Sheet 1)/D.cpp
// https://codeforces.com/group/MWSDmqGsZm/contest/219158/problem/D #include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; cout << "Difference = " << ((a*b)-(c*d)) << "\n"; return 0; }
ALGO
0.999878
4.638771
18327be3-ae81-4baf-9b97-8e33ad360d95
OttoBryant1997/LeetCodeResolutions
217.存在重复元素.cpp
/* * @lc app=leetcode.cn id=217 lang=cpp * * [217] 存在重复元素 */ // @lc code=start #include <set> class Solution { public: bool containsDuplicate(vector<int> &nums) { set<int> eles; bool result = false; for (auto val : nums) { if (eles.find(val) != eles.end()) ...
ALGO
0.999524
5.920912
9d70c44a-4a4c-4e43-9637-c658438eeb7a
Nasim-Imtiaz/UVA
UVA11679.cpp
#include <iostream> using namespace std; int main(){ int b,n,temp,c,d,v; while(scanf("%d %d",&b,&n)){ if(b==0 && n==0){ break; } int bank[b]; for(int i=0;i<b;i++){ scanf("%d",&temp); bank[i]=temp; } for(int i=0;i<n;i++){ scanf("%d %d %d",&d,&c,&v); bank[d-1]-=v; bank[c-1]+=v; } boo...
ALGO
0.999305
3.141333
9aad2ab7-cc4c-4aaa-bbb4-5c9c6f104075
Zivallo/Algorithm
SEA/D3/[SEA]3260_두 수의 덧셈.cpp
#include <iostream> #include <string> using namespace std; int T; string A, B; string calc(string A, string B) { string ret; int n = 0; for (int i = 0; i < A.length(); i++) { n += A[A.length() - 1 - i] - '0'; if (i < B.length())n += B[B.length() - 1 - i] - '0'; ret = (char)(n % 10 + '0') + ret; if (n >= 10)n...
ALGO
0.999886
4.892582
1768e563-821b-4407-91f7-1601a096dd13
Krish-Gupta-13/Udemy-GFG
GFG/Tree/04_postorder_traversal.cpp
//Code bhi krle kitna game khelega// #include<bits/stdc++.h> #include<iomanip> using namespace std; struct Node{ int key; struct Node *left; struct Node *right; Node(int k){ key=k; left=right=NULL; } }; void postorder(Node *root){ if(root!=NULL){ postorder(root->left)...
ALGO
0.999913
3.88117
7018a4ca-57ab-429b-9c61-4fa7946a7f4b
liqili/squashfs4.3
squashfs-tools/LZMA/lzmadaptive/C/Common/CRC.cpp
// Common/CRC.cpp #include "StdAfx.h" #include "CRC.h" static const UInt32 kCRCPoly = 0xEDB88320; UInt32 CCRC::Table[256]; void CCRC::InitTable() { for (UInt32 i = 0; i < 256; i++) { UInt32 r = i; for (int j = 0; j < 8; j++) if (r & 1) r = (r >> 1) ^ kCRCPoly; else r >...
ALGO
0.98541
6.396952
e08608be-4c68-4cd2-a9af-7d3699e3dc90
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_794_2.cpp
#include <bits/stdc++.h> using namespace std; void rwFile() {} const double PI = acos(-1); const long long MOD = 1009; const int maxN = 2e5 + 5; void fft(vector<complex<long double>> &a, bool invert) { int n = a.size(); if (n == 1) return; vector<complex<long double>> a0(n / 2), a1(n / 2); for (int i = 0; 2 * i...
ALGO
0.999994
3.860196
5dbf01e3-c197-4a34-bd1c-c75f17ad7d45
pilot1129/Algorithm-Study
Programmers/LV1/LV1. 콜라츠 추측.cpp
#include <string> #include <vector> using namespace std; int solution(int num) { long long newnum = num; int answer = 0; while(newnum != 1) { if(answer == 501) return -1; newnum%2 ? newnum = newnum *3 + 1 : newnum /=2; answer++; } return answer; } //https://...
ALGO
0.999993
5.704708
bf14d16c-21b6-4794-bc28-00e42de80c4f
ishandutta2007/codeforces
i_love_tigersugar/normal/526/E.cpp
#include<bits/stdc++.h> #define MAX 2000200 #define FOR(i,a,b) for (int i=(a),_b=(b);i<=_b;i=i+1) #define REP(i,n) for (int i=0,_n=(n);i<_n;i=i+1) using namespace std; int n,q; int a[MAX],range[MAX]; long long s[MAX]; void init(void) { scanf("%d%d",&n,&q); FOR(i,1,n) scanf("%d",&a[i]); FOR(i,1,n) a[n+i]=a...
ALGO
0.999877
3.488061
658a90b3-cd38-4275-851b-53af653c4398
Richard-Casey/Coding-Practice
Functions/FunctionPractice2/FunctionPractice1/main.cpp
#include <iostream> int multiply(int a, int b) // function created to handle the value of 'a' mnultiplied by 'b' { return a * b; } int main() { int result = multiply(4, 5); // called on the multiply function and given the int a and int b in parameters to multiply as per the fuction std::cout << result << std::en...
ALGO
0.997209
5.055177
5a0607e9-077b-40a7-b040-e664c6f5874f
hek-git/problem_solving
boj/20230808_2108.cpp
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <vector> #include <algorithm> #include <cmath> using namespace std; int N, num; int median, most, range, cnt = 1, sum, average; vector<int> candidate, v; int main() { scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d", &num); v.push_back(num); ...
ALGO
0.999819
3.806778
a8b8e3ea-8e11-40ec-aa54-35fa43bae873
JJANGORITHM/Programmers
Week 7/triSnail/dong.cpp
#include <iostream> #include <string> #include <vector> using namespace std; vector<int> solution(int n) { vector<int> answer; int** array = new int* [n]; for (int i = 0; i < n; i++) array[i] = new int[i+1]; int num = 1, x = -1, y = 0; for (int i = 0; i < n; i++) { switch (i%3) ...
ALGO
0.99992
4.073078
6bab3cd6-feb7-4a7a-abd0-271d68a56aa4
wbzhang233/online_test_imitation
meituan/2020/2020_2.cpp
// 字符串最长公共前缀 #include <iostream> #include <vector> #include <algorithm> #include <iomanip> using namespace std; int commlength(string s1,string s2) { if(!s1.length() || !s2.length() ){ return 0; } int res=0; int min_length = min(s1.length(),s2.length()); for(int i=0;i<min_length;i++){ ...
ALGO
0.999808
4.323141
818f6e1e-38cf-4a73-8bf2-5ce01038a8f1
suyash045/DSA
Striver SDE sheet/Stack and Queue/6LFU,Cache.cpp
#include<bits/stdc++.h> using namespace std; class node{ public: int key,val,cnt; node* next; node* prev; node(int _key,int _val){ key=_key; val=_val; cnt=1; next=NULL; prev=NULL; } }; class List{ public: int size; node* head; node* tail...
ALGO
0.999929
5.130402
9ff9dd20-f92d-45f0-9f8d-102472bd5282
60akramuddoula/C-Plus-Plus-For-DSA
Module 10 practice module extra/C_Simple_Calculator.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long int a,b; cin>>a>>b; cout<<a<<" "<<"+"<<" "<<b<<" "<<"="<<" "<<a+b<<endl; cout<<a<<" "<<"*"<<" "<<b<<" "<<"="<<" "<<a*b<<endl; cout<<a<<" "<<"-"<<" "<<b<<" "<<"="<<" "<<a-b<<endl; return 0; }
ALGO
0.998964
3.307089
7be08da9-2402-4be6-9a69-82536f9e59e9
Akilax0/CP
Algorithm_Coursera/week4_divide_and_conquer/5_number_of_inversions/inversions.cpp
#include <iostream> #include <vector> using std::vector; long long get_number_of_inversions(vector<int> &a, vector<int> &b, size_t left, size_t right) { long long number_of_inversions = 0; if (right <= left + 1) return number_of_inversions; size_t ave = left + (right - left) / 2; number_of_inversions += get_n...
ALGO
0.999964
4.447427
399c1c29-8d3d-4d33-a8ba-8cf7b8d2af91
Lincito-31/Preseleccion
Practice IOI/bitstrings/cpp/Range Queries/Range Updates and Sums.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct SEGMTENTTREE{ ll tam; vector<ll> arbol,nums; vector<pair<ll,ll>> lazy; void build(ll node,ll l,ll r){ if(l==r){ arbol[node]=nums[l]; return; } ll mid=(l+r)>>1,hiji=2*node+1,hijd=2*n...
ALGO
0.999629
4.309537
62066fb7-d68d-4b38-b0fb-e2f8b90abb5c
Ryb7532/AtCoder
submissions/abc367/f.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define GET_MACRO(_1,_2,_3,NAME,...) NAME #define rep3(i,s,e) for (int i=(int)s; i<(int)e; i++) #define rep2(i,n) rep3(i,0,n) #define rep1(n) rep2(_,n) #define rep(...) GET_MACRO(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__) #define ...
ALGO
0.999928
4.128864
d9f2cee2-051f-495a-b19b-7053fa82673d
Pooh1223/Online-Judge
Uva/195.cpp
#include <bits/stdc++.h> using namespace std; set<string> s; char order[55]; int main(){ int n; scanf("%d",&n); s.clear(); for(int i = 1;i < 52;i += 2){ order[i - 1] = char('A' + i / 2); order[i] = char('a' + i / 2); } while(n--){ char str[103]; int nm[103]; ...
ALGO
0.999894
4.208422
89c2d38c-6f00-41d4-8b4f-0a93b8a841c2
alexandraback/datacollection
solutions_5634697451274240_0/C++/ranaldmiao/b.cpp
#include <bits/stdc++.h> using namespace std; int TC, N, ans; char str[1050]; int main () { scanf("%d", &TC); for (int T = 1; T <= TC; ++T) { scanf("%s", str); N = strlen(str); ans = 1; for (int i = 1; i < N; ++i) { if (str[i] != str[i-1]) ++ans; } if ...
ALGO
0.999814
4.323115
0c5f4f67-3a55-451d-b86b-d3727fa980f9
cjtoribio/Algorithms
Codes/Trees/LinkCutTreeLab.cpp
struct LinkCutTree { struct Node { Node *p,*r,*l; int sz,gid,id; int edgeCost , upCost; Node(){ static int IDX = 0; p = r = l = NULL; sz = 1; gid = IDX++; id=0; edgeCost = 0 , upCost = 0; } bool isLocalRoot(){ return p == NULL || (p->r != this && p->l != this); } void pushDown(){ if(r)r...
ALGO
0.999314
3.518308
05d08941-fb43-4311-a486-56cf9a3c9629
ProjectInfinity-X/frameworks_av
media/module/codecs/amrnb/enc/src/calc_en.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/calc_en.c Funtions: calc_unfilt_energies calc_filt_energies calc_target_energy ------------------------------------------------------------------------------ MODULE DESCRIPTION ...
ALGO
0.999204
5.866442
c8463f15-ad86-4f85-8174-451581794e83
IncoCura/qt5
qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
#include "core/layout/compositing/CompositingRequirementsUpdater.h" #include "core/layout/LayoutView.h" #include "core/layout/compositing/PaintLayerCompositor.h" #include "core/paint/PaintLayer.h" #include "core/paint/PaintLayerStackingNode.h" #include "core/paint/PaintLayerStackingNodeIterator.h" #include "platform/i...
TOOL
0.889544
7.963527
51bbd7be-2eac-4f16-840d-10f033f878f3
xlfsummer/codewar-solutions
c++/other/Sum of positive.cpp
#include <vector> #include <cmath> int positive_sum (const std::vector<int> arr){ int sum = 0; for(auto i: arr) sum += (std::abs(i) + i) / 2; return sum; }
ALGO
0.993752
5.04679
846693f3-1e0c-4daa-9d25-69fa21d84946
yeye921/Algorithm-cpp
Programmers/Level2/기능개발.cpp
// 와우 어렵다... (시간 오래 걸림) // 일단은 벡터의 맨 처음 인자가 100이 되어야됨 // 이때 뒤에 있는 기능은 앞에 있는 기능이 배포될 때 함께 배포됩니다. // 각 배포마다 몇 개의 기능이 배포되는지를 return 하도록 solution 함수를 완성하세요. #include <bits/stdc++.h> using namespace std; vector<int> answer; int visited[104]; int func_num, current_idx; vector<int> solution(vector<int> progresses, vector<int...
ALGO
0.999453
4.897791
f9fa11a2-23d1-47d3-ad45-78c0ae10215f
olhabachurina/23classworkoop
23classworkoop.cpp
// 23classworkoop.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> class Character { public: virtual void Attack(Character* target) { std::cout << "You attack the enemy!" << std::endl; } }; class Player : public Character { public: void A...
TOOL
0.97184
5.549119
34a79be4-c164-4de2-8091-85c7e690ad3b
llvm/clangir
libc/src/stdfix/sqrtulr.cpp
#include "sqrtulr.h" #include "src/__support/common.h" #include "src/__support/fixed_point/sqrt.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(unsigned long fract, sqrtulr, (unsigned long fract x)) { return fixed_point::sqrt(x); } } // namespace LIBC_NAMESPACE_DECL
ALGO
0.971027
5.36839
cfc2e4b8-45c7-4be2-98b3-ad6f13801437
mohamedabdelhakem1/UCSD-data-structures-and-algorithms-specialization
1-Algorithmic toolbox/week4_divide_and_conquer/5_organizing_a_lottery/points_and_segments.cpp
#include <bits/stdc++.h> using namespace std; vector<int> fast_count_segments( vector<pair <int,int > > segments, vector<int> points) { vector <pair <int, int> > pairs(segments.size() * 2 + points.size()) ; vector<int> cnt (points.size()); unordered_map <int,vector <int> > mp; int i = 0; for(pair <...
ALGO
0.999983
4.863642
777cfee4-03f3-450e-963a-cb735dd5b6fc
karygauss03/Leetcode-Solutions
0835-image-overlap/0835-image-overlap.cpp
class Solution { public: int largestOverlap(vector<vector<int>>& img1, vector<vector<int>>& img2) { int N = img1.size(); vector<int> LA, LB; unordered_map<int, int> count; for(int i = 0; i < N*N; ++i) if(img1[i / N][i % N] == 1) LA.push_back(i / N * 100 + ...
ALGO
0.999391
5.830041
ee5db449-b85c-44a3-880e-172f01159d76
samarthfunde/Flutter-Project1
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998733
6.76775
0ca689e8-4a2a-476b-9dab-7281d093a3a9
SweCui/ros_ws
src/robot_tf/src/SolveTrajectory.cpp
/* @brief: 弹道解算 适配陈君的rm_vision @author: CodeAlan 华南师大Vanguard战队 */ // 近点只考虑水平方向的空气阻力 // TODO 完整弹道模型 // TODO 适配英雄机器人弹道解算 #include <math.h> #include <stdio.h> #include "robot_tf/SolveTrajectory.hpp" namespace robot_tf { RoboTtfNode::RoboTtfNode(const rclcpp::NodeOptions &options) : Node("robot_tf", optio...
ALGO
0.996773
3.171387
67511b9d-0f64-4dce-b236-7893c06d7e09
Hikari-no-Tenshi/crdroid_android_frameworks_av
media/libstagefright/codecs/amrnb/enc/src/p_ol_wgh.cpp
/* ------------------------------------------------------------------------------ Pathname: ./audio/gsm-amr/c/src/p_ol_wgh.c Funtions: p_ol_wgh_init p_ol_wgh_reset p_ol_wgh_exit Lag_max Pitch_ol_wgh Date: 02/05/2002 ---------------------------------------------------...
ALGO
0.997372
3.601306
40986585-5e82-4a0b-b4b8-897a224b4c32
moayman/problem_solving
uva/uva_12049.cpp
#include <iostream> #include <unordered_map> using namespace std; int main() { size_t T, N, M; int input; cin >> T; for (size_t i = 0; i < T; i++) { unordered_map<int, unsigned int> list1, list2; unsigned int output = 0; cin >> N >> M; for (size_t j = 0; j < N; j++) { cin >> input; list1[input]++;...
ALGO
0.999779
3.891662
7cf79303-15c5-4d7f-b01b-d45372743569
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_9378_12.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> A(n); for (int i = 0; i < n; i++) cin >> A[i]; vector<int> memo(n, 0); vector<bool> memo2(n, false); for (int i = n - 2; i >= 0; i--) { if (!memo2[A[i + 1] - 1]) { memo2[A[i + 1] - 1] = true; memo[i] = ...
ALGO
0.999907
4.095418
20b40150-379a-4a97-b5e1-d0710867411d
PANISHAR/Programming
Codeforces/Codeforces_Random/prob-22.cpp
// Rotate the given array 'Q' by k steps, where k is non-negative. // note : k can be greater than n as well where n is the size of array 'a'. /*#include<iostream> using namespace std; int main(){ int n = 6; int a[] = {1,2,3,4,5,6}; for(int i=1,j=3; i<j; i++,j--){ swap(a[i],a[j]); } fo...
ALGO
0.999632
4.927739
60aa91fa-d2bd-44ee-a80b-d60d8c637067
lawtonsclass/s25-code-from-class
csci40-in-person/lec04/ifelse.cpp
#include <iostream> #include <string> using namespace std; int main() { string today; cout << "Enter what day it is: "; cin >> today; if (today == "Wednesday") { cout << "Wear pink!\n"; } else { cout << "Don't wear pink!\n"; } // more straight-line code can go here... cout << "done\n"; r...
TOOL
0.888221
4.459384
f95b9cb3-653c-4a0e-ba54-82bc92a7f29a
hyeonseong0917/BOJ
random_silver/28014.cpp
#include <iostream> #include <algorithm> #include <vector> #include <cstring> #include <map> #include <deque> #include <cmath> using namespace std; #define ll long long #define pb push_back int main() { ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll t=1; // cin>>t; while(t--){ ll n; ...
ALGO
0.999895
4.551977
3ffb8f13-1e74-4c99-ad48-623196a6b48e
vandofb/opencv
modules/imgcodecs/src/loadsave.cpp
// // Loading and saving IPL images. // #include "precomp.hpp" #include "grfmts.hpp" #undef min #undef max #include <iostream> /****************************************************************************************\ * Image Codecs * \*******...
TOOL
0.956129
5.984334
2621a8cf-aa71-4000-b8ab-49d1a3a6db09
A-lioth/Cpp_Program
LeetCode/STL妙用/T769_Max-Chunks-To-Make-Sorted.cpp
#include <iostream> #include <vector> using namespace std; int maxChunksToSorted(vector<int> &arr) { int ret = 0, vSum = 0, iSum = 0; for (int i = 0; i < arr.size(); i++) { vSum += arr[i]; iSum += i; if (vSum == iSum) ret++; } return ret; } int main() { vect...
ALGO
0.999828
5.111432
caa19a9c-b328-4a4b-aa60-200e3baffb57
Mulab11/cntt2016-hw1
TC-SRM-577-div1-250/qiaoranliqu.cpp
#include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #include<vector> #include<set> #include<map> #include<bitset> #include<cmath> #include<string> #define ls (t<<1) #define rs ((t<<1)+1) #define mid ((l+r)>>1) #define fi first #define se second #define mk make_pair #define pb push_back #define N...
ALGO
0.999441
4.01248
b4af430a-e607-47e8-be11-cd287b3f78d9
raincross7/code-similarity
codes/train_code/problem192/problem192_288.cpp
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i<(n); i++) #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) using namespace std; typedef long long ll; int main() { int N, K; cin >> N >> K; vector<ll> x(N), y(N); vector<ll> xAry(N), yAry(N); //長方形の四隅の候補 rep(i, N) { ...
ALGO
0.999913
4.114011
e01ec041-7519-4bf6-afe5-3f75b292cd7d
AbdullaKhan01/GraphDSA
Day4/NumberOfDistinctIslands.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { private: void dfs(int row,int col,vector<vector<int>>&grid,vector<vector<int>>&vis, vector<pair<int,int>>&vec,int row0,int col0) { vis...
ALGO
0.999895
7.027809
99097448-1d6e-4787-b3c2-77de5938dc9b
12019/svn.gov.pt
_src/eidmw/FreeImagePTEiD/Source/FreeImage/WuQuantizer.cpp
/////////////////////////////////////////////////////////////////////// // C Implementation of Wu's Color Quantizer (v. 2) // (see Graphics Gems vol. II, pp. 126-133) // // Author: Xiaolin Wu // Dept. of Computer Science // Univ. of Western Ontario // London, Ontario N6A 5B7 // <EMAIL> // // Algorithm: Greedy ...
ALGO
0.999204
4.640417
c9efb3f1-8069-4b9f-abe7-fb9da01b10ee
rsore/unigraph
examples/math_app/main_entry/main.cpp
#include <algorithms.hpp> #include <circle.hpp> #include <iostream> #include <math_types.hpp> #include <statistics.hpp> int main() { // Demonstrate usage of MathTypes MathTypes::Vector2 v1(1.0f, 2.0f); MathTypes::Vector2 v2(3.0f, 4.0f); std::cout << "Vector1: (" << v1.x << ", " << v1.y << ")\n"; s...
ALGO
0.955588
4.312669
ebdbf251-b71a-4e3d-b510-d0282e0daf34
joonyle99/Algorithm
Solved.ac/Solved.ac/15686_chicken.cpp
#include <bits/stdc++.h> using namespace std; int N, M; int city[55][55]; bool closed[55][55]; vector<pair<int, int>> chickens; vector<pair<int, int>> houses; int minCityDist = 0x7f7f7f7f; void CalcCityDistance() { int cityDist = 0; // ȸϸ鼭 for (const auto& house : houses) { int chickenDist = 0x7f7f7f7f; // ġ...
ALGO
0.999889
4.798772
c2dfdc2c-cbea-486c-b7ac-933e88933073
AjayParneriya/Ajayse
18.cpp
// Write a program of to sort the array using templates. #include <iostream> // Template function to swap two elements template <typename T> void swap(T &a, T &b) { T temp = a; a = b; b = temp; } // Template function to partition the array template <typename T> int partition(T arr[], int low, int high) {...
ALGO
0.999993
6.295169
6dbd9b66-db10-46bc-af56-f7db93db61e2
Geetansh01/dsa-lb-codes
W16/V200_1_onwards_HWQues/V200_23_TargetSum.cpp
#include<bits/stdc++.h> using namespace std; int solveUsingRE(vector<int>& nums, int target, int index){ //BC if(index >= nums.size() && target == 0)return 1; if(index >= nums.size() && target != 0) return 0; int totWays = 0; //Option1 : make current number '+' int option1 = solveUsingRE(nums,...
ALGO
0.999988
5.07527
e29e2d40-49d5-47fe-b6e3-d8b7029b812e
hunmin-hub/Backjoon-judge
Solved2020/11725.cpp
#include <stdio.h> #include <vector> #include <unordered_map> #include <queue> using namespace std; unordered_map<int, vector<int>> graph; unordered_map<int, int> tree; queue<int> v_queue; bool visit[100002]; int main() { int m,x,y; int vertex; scanf("%d", &m); for (int i = 0; i < m - 1; i++) { scanf("%d %d", &x,...
ALGO
0.999984
4.308638
31aacdc9-d75e-4116-bb1b-087d6595aded
ttamx/Competitive-Programming
Practice/Treap/codecube_187.cpp
#include<bits/stdc++.h> using namespace std; struct item{ int idx,prio; char c; item *l,*r; item(){}; item(int idx,char c):idx(idx),prio(rand()),c(c){}; }; typedef item* pitem; void split(pitem t,pitem &l,pitem &r,int idx){ if(t==nullptr)l=r=t; else if(t->idx<=idx)split(t->r,t->r,r,idx),l=t; else split(t->l,...
ALGO
0.999883
4.362318
5bfedb62-1967-4fde-9460-2826f82c253b
staffle-zz/LeetCode_Challenge
Medium/ZigZag Conversion/ZigZagConversion.cpp
class Solution { public: string convert(string s, int numRows) { int n = s.length(); int i = 0; vector<string> ans(numRows); while(i < n){ for(int j = 0; i < n && j < numRows; j++ , i++){ ans[j] += s[i]; } for(int j = numRows - ...
ALGO
0.999981
6.207115
9fde5bbb-65bd-4700-9de7-1cd82dbdccdf
justhusnan/CppDroid
tutorials/cplusplus.com#1.0#1/classes/polymorphism/abstract_base_classes/source6.cpp
// dynamic allocation and polymorphism #include <iostream> using namespace std; class Polygon { protected: int width, height; public: Polygon (int a, int b) : width(a), height(b) {} virtual int area (void) =0; void printarea() { cout << this->area() << '\n'; } }; class Rectangle: public Poly...
TOOL
0.964573
5.125687
3a634c1f-deae-4de6-89ac-a3c0860b4228
mprateek14/LeetCode-Solutions
1-two-sum/1-two-sum.cpp
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> result; for(auto it = nums.begin(); it!=nums.end(); it++){ auto it2 = find(it+1, nums.end(), target - *it); if(it2 != nums.end()){ result.push_back(it-num...
ALGO
0.999756
6.266158
8a18e015-7dd4-497d-85c3-67cee60417fc
rikazry/BasicAlgo
prime_factor.cpp
#include <iostream> #include <vector> using namespace std; vector<int> prime_factors(int n){ vector<int> factors; for (int i = 2; i <= n/i; ++i){ int new_flag = 1; while (n % i == 0){ if(new_flag == 1){ factors.push_back(i); new_flag = 0;} n /= i; } } if (n > 1) factors.push_back(n); ...
ALGO
0.999395
4.164417
e3561ba1-26c1-46e5-a8ee-3816469cdab8
BrasilEstevao/Micro-Rato-2025
src/path_handler.cpp
#include <stack> #include <string> #include <Arduino.h> //#define FOLLOW LEFT #define FOLLOW RIGHT // #define DEBUG using namespace std; stack<char> movements_made; // Stack to store movements made // Function to get the path from the original stack // This function will process the stack and return a new stack wit...
ALGO
0.999608
5.554526
7e668319-6433-40d1-826b-7b6ab6b810ed
Raaz-Dvaa/DZ1
sorts.cpp
#include <iostream> #include "sorts.h" void test_sort (int* ar, int size){ for (int k = 0; k < size - 1;k++){ if (ar[k] - ar[k+1] > 0){ std::cout << "fail"; break; } } } int getMax(int* ar, int size){ int max = 0; int i=1; while (i<size){ if (ar[max]...
ALGO
0.979254
4.379683
d2d96efb-eb2c-47e0-8503-df7e4e52f8ff
raincross7/code-similarity
codes/train_code/problem041/problem041_446.cpp
#include<bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define put(i) cout<<fixed<<i<<endl using namespace std; using ll = long long; int main(){ int n, k; cin >> n >> k; vector<int> l(n); rep(i,n) cin >> l[i]; sort(l.begin(), l.end(), greater<int>()); put(accumulate(l.begin...
ALGO
0.999965
3.292057
d3f8c447-d82f-4715-b4ef-204daa2b750d
arm/arm-toolchain
libc/src/stdbit/stdc_count_ones_us.cpp
#include "src/stdbit/stdc_count_ones_us.h" #include "src/__support/CPP/bit.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(unsigned, stdc_count_ones_us, (unsigned short value)) { return static_cast<unsigned>(cpp::popcount(value)); } ...
TOOL
0.928933
6.815109
338d3d3b-9f00-432f-a8cb-d016f9d4ae7e
NILAVARASAN-M/Leetcode-Solutions-cpp
stack's/EASY/496. Next Greater Element I/montonic_method_1.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) { vector<int> vect(nums2.size(), -1); stack<int> sta; for(int i=nums2.size()-1;i>=0;i--){ while(!sta.empty() && sta.top()<=nums2[i]){ ...
ALGO
0.999974
5.382791
f30dfa16-46c6-4921-9feb-0dd9d3af6738
joshishreya19/mi_card_flutter
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
e7eca214-7cd0-451e-8dc2-bde7696f1d15
arjunvkurup/18CA382-Competitive-Programming
Dijkstras Algorithm/dijkstrasAlgorithm.cpp
// Dijkstras Algorithm implemented using C++ #include<bits/stdc++.h> using namespace std; int minimumDist(int dist[], bool flag[]) { int min = INT_MAX, index; for(int i = 0; i < 6; i++) { if(flag[i] == false && dist[i] <= min) { min = dist[i]; index = i; } } return index; }...
ALGO
0.999937
4.363779
c717d47c-00d1-43cf-9523-0d5ab6e1d4f4
Rohitsah12/CPP-DSA
basics/volumeofsphere.cpp
#include<bits/stdc++.h> using namespace std; int main(){ float radius=5; float pi = 3.1415; cout<<(4/3)*pi*radius*radius*radius; }
ALGO
0.999814
3.929678
0902bd95-a37a-4f3c-aeb4-abc5d931a4fe
shipul329/Dynamic-Programming
palindromic_partitioning.cpp
// to solve mcm pattern problems follow these 4 steps // i) find value of i & j // ii) base condition // iii) find loop for K // iv) function for temporary ans(min, max) #include<bits/stdc++.h> using namespace std; #define for0(i, n) for(int i=0; i<n; i++) #define for1(i, n) for(int i=1; i<=n; i++) #define all(...
ALGO
0.999914
5.273695
0cb27a7a-0b67-45ee-bce1-4bdb0302adcd
HETONGAPP/QGC-Spiri
libs/eigen/doc/examples/tut_matrix_resize.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { MatrixXd m(2,5); m.resize(4,3); std::cout << "The matrix m is of size " << m.rows() << "x" << m.cols() << std::endl; std::cout << "It has " << m.size() << " coefficients" << std::endl; VectorXd v(2); v.resize(5); ...
ALGO
0.973274
3.882785
1feec016-a16a-4a53-8f7b-ff3c0ce6d847
techadarshmishra/C-folder
test.cpp
#include<iostream> using namespace std; int main(){ int n,row=1; cout<<"enter the number"<<endl; cin>>n; cout<<endl; while(row<=n){ int col=1; while(col<=n){ char ch='A'+col-1; cout<<ch; col=col+1; } cout<<endl; row=row+1; ...
ALGO
0.99765
3.422794
9cfef15e-3a96-46c9-8bd2-93df8c6b21b5
pku-liang/popa
Halide/test/correctness/stream_compaction.cpp
#include "Halide.h" #include <stdio.h> using namespace Halide; int main(int argc, char **argv) { // A zero-one function: Func f; Var x; f(x) = select((x % 7 == 0) || (x % 5 == 0), 1, 0); f.compute_root(); // Take the cumulative sum. To do this part in parallel see the parallel_reductions tes...
ALGO
0.987236
5.443133
6d919871-75e5-4b3f-8644-93942dcc77cc
aayushwadhwa1/Competitive-Coding
Codechef/MAY20B/COVID19.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define mp make_pair #define pb push_back #define rep(i,n) for(i=0;i<n;i++) #define sd(thapar) scanf("%d",&thapar) #define sc(thapar) scanf("%c",&thapar) int main(){ int t; sd(t); while(t--) { int n; cin>>n; int x[n]; for(int i=0;i<n;i++)...
ALGO
0.999862
3.438836
21f6be0b-e285-4fee-b925-6b00d8544777
Showrov-CoU/Codeforces-Solution
A_And_Then_There_Were_K.cpp
#include <bits/stdc++.h> #define PI 2*acos(0.0) #define ll long long int #define ull unsigned long long int #define MOD 1e9+7 #define endl ("\n") #define vector vector<ll> #define gcd(a,b) __gcd(a,b) #define lcm(a,b) (a*(b/__gcd(a,b))) #define FAST ...
ALGO
0.999985
4.985025
b8dff2e2-f878-4d6e-89a8-e333d0b829a5
98andwin/Kattis_solutions
Problems/Veci/veci.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string digits; cin >> digits; int lower = 0; for (int i = digits.size()-1; i > 0; i--){ if (digits[i] > digits[i-1]){ lower = i; break; } } if (lower == 0){ ...
ALGO
0.999887
5.311378
be313661-4781-475e-8242-b15666923fea
JonathanMoralde/home_app
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.9988
6.76073
15bb6924-640d-4a4f-a475-df921721b1f0
ishandutta2007/codeforces
zdolny_kaczor/normal/1148/A.cpp
//Konrad Paluszek, University of Warsaw (former XIV LO Warsaw) #ifndef LOCAL #pragma GCC optimize("O3") #endif #include <bits/stdc++.h> using namespace std; #define sim template <class c #define mor > muu & operator<< ( #define ris return *this #define urs(r) typename remove_cv<typename remove_reference<decltype(r)>::t...
ALGO
0.99983
4.189923
a3ba284c-a89c-4fc6-92d3-e94c9c3b184a
redgum775/AtCoder-submissions
submissions/abc267/a.cpp
//#include <bits/stdc++.h> #include <iostream> #include <string> #include <vector> #include <algorithm> using ll = long long; typedef long long ll; using llu = unsigned long long; typedef unsigned long long llu; using namespace std; int main() { string S; cin >> S; if(S == "Monday") cout << 5 << endl; if(S ...
ALGO
0.999882
3.912479
f3787c07-597b-4698-9a38-be0ec2fab718
ishandutta2007/codeforces
dlalswp25/normal/1393/C.cpp
#include <bits/stdc++.h> using namespace std; int N; int cnt[101010]; int main() { int tc; scanf("%d", &tc); while(tc--) { scanf("%d", &N); for(int i = 1; i <= N; i++) cnt[i] = 0; for(int i = 1; i <= N; i++) { int a; scanf("%d", &a); cnt[a]++; } int mx = 0, mc = 0; for(int i = 1; i <= N; i++) { ...
ALGO
0.999765
4.022068
0b3a5e8d-e8a0-4dca-b6d1-66afd84285c1
n6xej/b176cmake
boost_1_76_0/libs/math/src/tr1/cyl_bessel_jf.cpp
extern "C" float BOOST_MATH_TR1_DECL boost_cyl_bessel_jf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x) BOOST_MATH_C99_THROW_SPEC { return c_policies::cyl_bessel_j BOOST_PREVENT_MACRO_SUBSTITUTION(nu, x); }
TOOL
0.887226
3.438202
6b860ac7-6996-4330-b075-2f6dee00aff7
Aqsa2209/OOP-LAB-TASKS-24k-0923-
OOP lab 6/task1.cpp
#include <iostream> #include <string> using namespace std; class BankAccount { protected: string accountNumber; double balance; public: BankAccount(const string& accNum, double initialBalance) : accountNumber(accNum), balance(initialBalance) {} void deposit(double amount) { balance +...
TOOL
0.961422
5.661399
28ce9b4f-1e0c-4f94-a58a-fd2e88e67513
22MH1A42G5/LeetCode
1877-minimize-maximum-pair-sum-in-array/1877-minimize-maximum-pair-sum-in-array.cpp
class Solution { public: int minPairSum(vector<int>& nums) { int n=nums.size(); int i=0; int j=n-1; int max=0; sort(nums.begin(),nums.end()); while(i<j){ if(nums[i]+nums[j]>max){ max=nums[i]+nums[j]; } i++; ...
ALGO
0.999989
5.931091
92bc6cf0-ddf4-43b2-bd64-b55984149642
Madmins07/Competitive-Programming
codeforces/1829B.cpp
#include<bits/stdc++.h> #define ll long long #define ull unsigned long long #define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL)); using namespace std; int main() { fastread(); int n,t,a; cin>>t; while(t--){ cin>>n; int count=0,max=0; ...
ALGO
0.999803
3.998169
5b02f6a2-bb52-4941-a400-762e45085ab6
Snitro/Competition
Luogu/P1013 进制位.cpp
#include <cstdio> #include <cstdlib> #include <string> #include <iostream> using namespace std; int n; string str[10][10]; // string name[10]; string one; int ans[10]; void setAns(string na, int a) { for (int i = 1; i < n; i++) if (name[i] == na) { if (ans[i] != -1 && ans[i] != a) { cout << "ERROR!";...
ALGO
0.999714
3.642452
6e2f3244-ebc6-43e8-a348-626435acd3f7
SD691/DSA
1360-maximum-length-of-a-concatenated-string-with-unique-characters/maximum-length-of-a-concatenated-string-with-unique-characters.cpp
class Solution { public: // for aa bool duplicates(string s){ set<char> st; for(int i=0; i<s.size(); i++){ if(st.find(s[i])!=st.end()){ return false; } st.insert(s[i]); } return true; } // valid string bool unique(string s,...
ALGO
0.999899
5.676508
f42ff570-86a9-4821-8937-26533c7d9ec9
kikugawa-shoma/Atcoder
APG4b/6.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; char op; string er = "error"; cin >> a >> op >> b; if(op == '+')cout << a+b; else if(op == '-')cout << a-b; else if(op == '*')cout << a*b; else if(op == '/'){ if(b == 0)cout << er; else cout << a/b; } ...
ALGO
0.999592
3.776218
593f2860-86b5-4aa5-bd9a-94993dccc232
karlstratos/singular
third_party/eigen-eigen-36fd1ba04c12/unsupported/doc/examples/PolynomialUtils1.cpp
#include <unsupported/Eigen/Polynomials> #include <iostream> using namespace Eigen; using namespace std; int main() { Vector4d roots = Vector4d::Random(); cout << "Roots: " << roots.transpose() << endl; Eigen::Matrix<double,5,1> polynomial; roots_to_monicPolynomial( roots, polynomial ); cout << "Polynomial:...
ALGO
0.998157
4.015535