uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
65ab88a6-4d98-4753-aa56-4fc1bd1cf6e1 | vats98754/Anvays-Competitive-Programming-Algorithms | range-segment-tree-sum.cpp | // C++ program to show segment tree operations like construction, query
// and update
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
// A utility function to get the middle index from corner indexes.
int getMid(int s, int e) { return s + (e -s)/2; }
/* A recursive function to get the s... | ALGO | 0.999923 | 6.13351 |
65bad753-a5a2-43e2-9099-b69776d5acef | neelchoudhury/cp | Codechef and Spoj/L-Z/t.cpp | #include<iostream>
using namespace std;
void f(int x,int y, int a[],int n,int cnt)
{
if(a[x-1]!=0 and a[y-1]!=0)
{
int s=a[x-1]<a[y-1]?a[x-1]:a[y-1];
int b=a[x-1]>a[y-1]?a[x-1]:a[y-1];
for(int i=0; i<n; i++)
{
if(a[i]==b)
a[i]=s;
}
}
else if (a[x-1]==0 and a[y-1]!=0)
{
a[x-1]=a[y-1];
}
else ... | ALGO | 0.999981 | 3.88234 |
fd3f87a8-2e98-49ad-a834-962307037987 | waqar2403/Leetcode | 542-01-matrix/01-matrix.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int n = mat.size();
int m = mat[0].size();
vector<vector<int>> ans(n, vector<int>(m, INT_MAX));
vector<vector<int>> vtd(n, vector<int>(m, 0));
queue<pair<pair<int, int>, int>> q;
... | ALGO | 0.999979 | 7.169847 |
621dc871-662e-4ab1-bdb4-fb03945c0cfb | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3029_1.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 400005;
char s[N], t[N];
vector<int> S, T;
int n, m, xx, yy;
int calc(int n, int m, char x, char y) {
if (n && m && x == y) n < m ? n++ : m++;
return max(n, m) - 1;
}
int main() {
scanf("%s%s", s, t);
int ls = strlen(s);
int lt = strlen(t);
s[ls] =... | ALGO | 0.999985 | 3.679592 |
1da80b8c-0b81-4af6-8f0e-86205f1a0008 | Mycohen/Introduction-to-Computer-Science | Exercises/Exercise 13/13.2.cpp | #include <iostream>
#include <fstream>
using namespace std;
namespace Exercises {
/**
* Counts the occurrences of a given string in a file.
*
* @param file The input file stream.
* @param searchStr The string to search for.
* @return The number of occurrences of the search string in the f... | TOOL | 0.976291 | 7.016447 |
e0418d94-f87c-40a2-a3f1-3fb3750e5223 | zwshen/notes-learning | skills/Acm/Others/my-idle-codes/maratona/UVa/p591.cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
int main() {
int n, sets=1;
scanf("%d", &n);
while (n) {
vector<int> bricks;
bricks.reserve(n);
int result, av=0, pos=0, neg=0;
for (int i=0; i<n; i++) {
int temp;
scanf("%d", &temp);
av+=temp;
b... | ALGO | 0.999743 | 3.206446 |
7f5559f3-e1e3-4538-a1b2-cbedd64f92c3 | thegamer1907/Code_Analysis | Graphs/2268.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> g[2002];
int n;
int rt;
int dfs(int u){
int ret=0;
for(auto v: g[u]){
ret=max(ret, 1+dfs(v));
}
return ret;
}
int main(){
cin >> n;
rt=n+1;
int x;
for(int i=1; i<=n; ++i){
cin >> x;
if(x==-1){
g[rt].push_back(i);
}else{
g[x].push_back(i... | ALGO | 0.999811 | 3.778359 |
34f64f31-27cc-4cf0-9e07-fa5aa2e01c1a | Wenremo/Fusion3D | texturing/texturing/elibs/eigen/test/visitor.cpp | #include "main.h"
template<typename MatrixType> void matrixVisitor(const MatrixType& p)
{
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::Index Index;
Index rows = p.rows();
Index cols = p.cols();
// construct a random matrix where all coefficients are different
MatrixType m;
m... | TEST | 0.901469 | 6.138896 |
83ba843c-4bf9-4bab-905f-0da9d0638301 | DeepanshuRohilla15/Constructive-Algo | Balanced Rating Changes.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> v(n);
int odd = 0;
for(int i = 0; i < n; i++)
{
cin>>v[i];
if(v[i]%2) odd++;
}
odd = odd/2;
for(auto x : v)
{
if(x%2)
{
if(odd > 0) odd--, x--;
... | ALGO | 0.999982 | 3.655952 |
7dbd4898-b1ed-49fd-9464-05163e40998d | kks227/BOJ | 3200/3267.cpp | #include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
const int MAX = 100000;
typedef pair<int, int> intPair;
int diameter = 0;
vector<intPair> adj[MAX];
bool visited[MAX] = {0};
int height(int node){
visited[node] = true;
if(adj[node].empty()) return 0;
int fValue = 0, s... | ALGO | 0.999955 | 4.215046 |
4788b290-7155-4081-9f31-7018b1251482 | prakashsingh1609/100-Days-Of-Code | Day 60/SearchInABST.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.999992 | 5.81363 |
dc2bb52d-c02f-48a6-af9f-d9a555b4c9a4 | december3th/Cpp | dem so phan tu lap lai.cpp | #include<bits/stdc++.h>
using namespace std;
main () {
int k;
cin >> k;
while (k--) {
int n;
cin >> n ;
int a[n];
int dem = 0 ;
int count ;
int kt ;
for ( int i = 0 ; i < n ; i ++) cin >> a[i];
for ( int i = 0 ; i < n ; i ++) {
count = 1 ;
kt = 0 ;
for ( int j = 0 ; j < n ; j ++) {
if (... | ALGO | 0.999514 | 3.575509 |
ba16278b-754d-4f76-a7af-c2c73924d6e0 | poke19962008/Competitive-Coding | CodeForces/835B.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <set>
using namespace std;
#define EPS 1e-9
#define INF (int)1e9
#define MOD 1000000007
#define MAXN 1000006
#d... | ALGO | 0.999888 | 3.982912 |
37101a86-0a6d-4758-afc6-8e19c6ebd9ea | RJD02/DSA-Practice | coding-ninjas/Stacks/brackets_balanced.cpp | #include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
bool isBalanced(string expression) {
stack<char> st;
for(auto i: expression) {
if(!st.empty() and i == ')') st.pop();
else if(st.empty() and i == ')') return false;
else st.push(i);
}
if(st.size(... | ALGO | 0.982657 | 5.377068 |
0aa5d881-04ce-4241-8f6c-b617bf1a6c41 | nhdotvn/kithuatlaptrinh | recursion/18.cpp | #include <iostream>
using namespace std;
int newton(int k, int n){
if(k == 0 || k == n){
return 1;
}
else
return newton(k -1 , n-1 ) + newton(k , n-1 );
}
int main()
{
int n,k;
cout<<"Enter a values of n and k: ";
cin>>n>>k;
cout<<"\nResult of newton's binomial: "<<newton(k,n)... | ALGO | 0.999813 | 4.28197 |
3356489c-2f37-4b54-96a8-43488ff5a82c | shariar-opu/CFsolve | Cumulative_Sum_Query.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define watch(x) cerr << "\n" \
<< (#x) << " is " << (x) << endl
#define time cerr << "time = " << clock() << " ms" << '\n'
#define optimize() \
ios_base ::sync_with_stdio(0); \
cin.tie(0);... | ALGO | 0.999956 | 4.660149 |
6a1ae0a5-0595-4040-bc10-21dc1a5f64c7 | Kelrogg/Crypto | key_finder/src/main.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <cmath>
#include <set>
#include <cctype>
#include "argparse/argparse.hpp"
#include "FileInputStream.h"
#include "mod_math_lib.h"
#include "set_intersection.hpp"
using SetOfChars = std::set<uint8_t>;
SetOfChars ReadS... | ALGO | 0.997924 | 4.922367 |
dd1566fa-3fde-46af-89e1-62c20da1a509 | Xohail69/Leetcode | 78-subsets/78-subsets.cpp | class Solution {
public:
void dfs(vector<vector<int>> &ans , vector<int> &sub , vector<int> &nums , int start){
ans.push_back(sub) ;
for(int i = start ; i < nums.size() ; i++ ) {
sub.push_back(nums[i]) ;
dfs(ans , sub , nums , i+1 ) ;
sub.pop_back() ;... | ALGO | 0.999934 | 6.1691 |
97ddad1f-9e5d-4c25-bcbb-f14b6c8b1d2c | ishandutta2007/codeforces | tearinfree/normal/319/B.cpp | #include <cstdio>
#include <algorithm>
#include <stack>
#include <utility>
using namespace std;
typedef pair<int,int> pii;
int n,arr[100001],chk[100001];
int main() {
stack<int> stk;
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",arr+i);
int m=0;
for(int i=1;i<=n;i++) if(m<arr[i]){
m=arr[i];
chk[i]=1;
}... | ALGO | 0.999965 | 4.291713 |
2e98e20a-f48d-4f46-80c5-62ee4fb4e10d | lap110303/Projetos | ALG1/TP1/src/batalhao.cpp | #include "batalhao.hpp"
#include <stack>
#include <queue>
#include <climits>
Batalhao::Batalhao(const Graph& g) : grafo(g) {
int n = grafo.getTotalCenters();
adjListReverso.resize(n);
for (int u = 0; u < n; ++u) {
for (int v : grafo.adjList[u]) {
adjListReverso[v].push_back(u);
... | ALGO | 0.99943 | 5.601014 |
271418e7-48b0-469a-9311-a804d97d99bb | DeependraParmar/Object-Oriented-Programming-and-Methodology | 26_dynamicMemoryAllocation.cpp | #include <iostream>
using namespace std;
void fillArray(int *arr,int n){
for(int i=0; i<n; i++){
cout<<i<<": ";
cin>>arr[i];
}
}
void displayArray(int *arr,int n){
for(int i=0; i<n; i++){
cout<<arr[i]<<" ";
}
}
int main(){
int n;
cout<<"Enter the size of the array: ";
... | TOOL | 0.89543 | 3.351229 |
2c1d3b07-2946-4dbe-9c2d-3a7213493a0a | Tphuong612/DSA | DSA anh loc/16. ngan xep hang doi/hang doi bai 1 thao tac 1.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int t;
cin>>t;
queue <int> q;
while(t--){
int n;
cin>>n;
if(n==1){
cout<<q.size();
cout<<endl;
}
else if(n==2){
if(q.empty()) cout<<"YES";
else cout<<"NO";
cout<<endl;
}
else if(n==3){
int a;
cin>>a;
... | ALGO | 0.999869 | 4.079772 |
2a99f809-9ffd-49e6-b876-301adae8a348 | CunZy/codetree-TILs | 231109/세 정수의 최솟값/minimum-of-three-numbers.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int a, b, c;
cin >> a >> b >> c;
int m = a;
if(m > b) {
m = b;
}
if (m > c) {
m = c;
}
cout << m;
return 0;
} | ALGO | 0.999482 | 4.284685 |
ee6b2413-7f5f-4c48-afbd-af8914e51002 | Shuiliusheng/MBAPIS | checkpoint_riscv/createCkpt_gem5/src/systemc/tests/systemc/misc/v1.0/dash3/pulse.cpp | /*****************************************************************************
pulse.cpp -- Implementation of the pulse generator.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*****************************************************... | TOOL | 0.855617 | 6.377377 |
7a9730bc-6e52-460f-bc9e-d3858f4803e7 | kypomon/NKU_cryptography_project | 公钥密码算法RSA/myrsa2/myrsa2/main.cpp | #include<iostream>
#include<ctime>
#include"BigInt.h"
#include"rsa.h"
#include<windows.h>
using std::cout;
using std::endl;
using std::cin;
void menu()
{//˵ʾ
cout<<"==========ӭrsaܽ=========="<<endl;
cout<<" e.encrypt "<<endl;
cout<<" d.decrypt "<<endl;
cout<<... | ALGO | 0.982532 | 3.191431 |
cab04381-cad1-4ff3-9d22-4029499a08db | Mohd-Arbaz-Ali/CP-codes-and-templates | CPP code/Arrays/1D Array/MaxSumCircularSubarray.cpp | #include<bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int n;
cin>>n;
int *ar=new int[n];
int Sum=0;
for(int i=0;i<n;i++){
cin>>ar[i];
Sum+=ar[i];
}
for (int i = 0; i < n; ++i)
{
ar[i]=-ar[i];
}
int curSum=0;
int maxSum=INT_MIN;
for(int i=0;i<n;i++){
curSum+=ar[i];... | ALGO | 0.999987 | 3.740999 |
741f6374-d1c0-47b1-98b3-4a55cb123a9a | RobertLata/MedHive | medhive/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.998823 | 6.76073 |
bc74d534-0245-4e5d-b20d-797d983ac791 | FangLiu68/LC2016 | LC2016/Get Left Subtree Nodes.cpp | // How to store how many nodes in each node's left-subtree?
#include <iostream>
using namespace std;
struct TreeNode{
int val;
TreeNode* left;
TreeNode* right;
int left_subtree_nodes;
TreeNode(int v) : val(v), left(NULL), right(NULL), left_subtree_nodes(0){}
};
// 也是从下往上返回值
int store_leftNodes(Tr... | ALGO | 0.999678 | 5.522516 |
1d865293-f0c8-4f7a-aedc-9f38b496c074 | zhudzh/USACO | Ordered Fractions_Sort.cpp | /*
ID: zdzapple
LANG: C++
TASK: frac1
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <climits>
#include <fstream>
#include <math.h>
#include <iomanip>
#include <stdlib.h>
using namespace std;
const string inpu... | ALGO | 0.999894 | 4.015344 |
ef49540f-004f-4fe8-9f96-acaa238f8b2d | MasovicHaris/etf-alles | III semester/numerical-algorithms/zadace/Z3/Z2/main.cpp | //NA 2018/2019: Zadaća 3, Zadatak 2
#include <iostream>
#include <cmath>
#include <vector>
#include <limits>
template <typename FunType>
std::pair<double, bool> Limit(FunType f, double x0, double h = 0, double eps = 1e-8, double nmax = 20){
if(eps <= 0 || nmax < 3 || nmax > 30) throw std::domain_error("Invalid para... | ALGO | 0.999478 | 4.607494 |
9c1eb208-a7e3-4c4c-b614-bd19c565f9ad | Zannysss/Project_Final | 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 |
8d759cf9-a8a6-4530-a7b6-51fca6fb6d71 | wang12d/ProgrammingPractices | ProjectEuler/pe659.cpp | #include <bits/stdc++.h>
#include "Toolbox.h"
using ul = unsigned long;
using std::cout;
using std::endl;
using std::max;
using std::unordered_set;
using std::vector;
template <typename T>
std::vector<T>
findPrimes(const T& n)
{
T i, j; // use long in case overflow
std::vector<bool> is_prime(n+1, true);
... | ALGO | 0.999925 | 4.68205 |
88216546-6f96-482f-9aaa-6d12419166e0 | mission365/leetcode_problems | 0169-majority-element/0169-majority-element.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
int n = nums.size();
unordered_map<int,int> mp;
for(int i=0;i<n;i++){
mp[nums[i]]++;
}
int mx = 0;
int ans;
for(auto it: mp){
if(it.second>mx){
mx = it.se... | ALGO | 0.999898 | 5.674357 |
7fb45117-2d73-4126-a51b-f51c929e0eaf | ayush8006/competitive-Proagramming | 1669_h.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(){
int n;
int k;
cin>>n>>k;
vector<int>a(n);
for(int i=0;i<n;i++){
cin>>a[i];
}
vector<int>bitscount(32,0);
for(int i=0;i<n;i++){
int temp=a[i];
for(int j=30;j>=0;j--){
if(temp&(1<<j)){
... | ALGO | 0.999852 | 4.153326 |
f6566a2b-2980-436e-82eb-97262570ca57 | ishandutta2007/codeforces | heno239/normal/1214/A.cpp | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#in... | ALGO | 0.999914 | 3.335468 |
690e76b1-46d6-49ce-9551-b75bbf072f69 | SohithPenumajji/6Companies30Days | Random Flip Matrix/main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
class Solution {
public:
Solution(int m, int n) {
rows = m;
cols = n;
total_zeros = m * n;
matrix = new int*[rows];
for (int i = 0; i < rows; ++i) {
matrix[i] = new int[cols]();
}
srand(time(... | ALGO | 0.946192 | 6.202901 |
7c58e601-a9d4-406a-83f5-8e1e068db41c | KANTNOLI/StudentCppRevisionTask08Project | StudentCppRevisionTask08Project/task02.cpp | #include "tasks.h"
/* Task 02. Arithmetic progression [арифметическая прогрессия]
*
* Даны четыре целых числа. Определите, являются ли данные числа
* (в указанном порядке) последовательными членами простейшей арифметической прогрессии и,
* если да, то какая именно задана арифметическая прогрессия: возрастающая, у... | ALGO | 0.999336 | 4.086994 |
8e6744c6-7041-42dd-ac85-b713bf09b733 | Soumyadipmaity1/DSA-in-C-3rd-Semester | #class 10/circularsingle_add_begin.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
// Utility function to print the list
void printList(struct Node* head) {
struct Node* temp = head;
if (head == NULL) {
printf("List is empty\n");
return;
}
do {
printf("%d -> ", temp->data);
temp = temp->... | ALGO | 0.997124 | 5.620473 |
8587a820-af67-4cb7-bcf9-3758ee8275a3 | ger0/t3tris | src/shift.cpp | #include "shift.hpp"
Shift shiftDir = None;
bool canShiftDown = false;
bool canShift = false;
int gameCycles = 100;
// TODO change
unsigned cycles = 0;
unsigned dasCycles = 0;
unsigned arrCycles = 0;
unsigned downCycles = 0;
unsigned stuckCycles = 0;
unsigned clearedLines = 0;
bool shiftDown(Pack *curr) {
... | ALGO | 0.917662 | 4.178161 |
4e72cd9d-4b3b-4d1b-9894-1b154f1d33a6 | yueying/openslam | 3rdparty/g2o/g2o/types/types_seven_dof_expmap.cpp | #include "types_seven_dof_expmap.h"
namespace g2o {
VertexSim3Expmap::VertexSim3Expmap() : BaseVertex<7, Sim3>()
{
_marginalized=false;
_fix_scale = false;
}
EdgeSim3::EdgeSim3() :
BaseBinaryEdge<7, Sim3, VertexSim3Expmap, VertexSim3Expmap>()
{
}
bool VertexSim3Expmap::read(std::istream&... | ALGO | 0.89189 | 5.897466 |
d20a880a-e497-43a4-b5cb-e4ce4db12c7e | Hemant4568/My-Code-Repository | 0189-rotate-array/0189-rotate-array.cpp | class Solution {
public:
void rotate(vector<int>& nums, int k) {
int n=nums.size();
k=k%n;
reverse(nums.begin(),nums.begin()+(n-k));
reverse(nums.begin()+(n-k),nums.end());
reverse(nums.begin(),nums.end());
}
}; | ALGO | 0.999993 | 6.009028 |
78761a15-aef9-4d39-bf1c-8c43ec4e7fc2 | huashu996/Ubuntu20.04LSD_SLAM | lsd_slam_core/src/GlobalMapping/FabMap.cpp | #ifdef HAVE_FABMAP
#include "GlobalMapping/FabMap.h"
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include "openfabmap.hpp"
#include "util/settings.h"
#include "DataStructures/Frame.h"
namespace lsd_slam
{
FabMap::FabMap()
{
valid = false;
std::string fabmapTrain... | ALGO | 0.940357 | 6.026456 |
c79c39d8-ca31-4977-b5d8-151c13fb44ed | Topera-020/introducao_a_programacao | vizinhos.cpp | //Prova tpicos de Programao
//Thales Gomes Maurin
//11175712
//Engenharia mecatrnica EESC-USP
#include <iostream>
#include <cstdlib>
#include "vizinhos.h"
#define LEN 20
using namespace std;
vizinhos::vizinhos(int A [LEN][LEN])
{
float soma;
//vamos comecar com dois fors para ler a matriz A;
for (int i=0; i<L... | ALGO | 0.997128 | 3.202743 |
fea8785f-c5a3-4915-b1d2-2ce315720a8b | TazmeenAfroz/Data_Structures | Stack/stack_Array_class.cpp | #include<iostream>
using namespace std;
class List
{
int *arr;
int *curr;
int capacity;
int length;
public:
List(int c);
~List();
void next();
void back();
void start();
void tail();
void insert(int val,int pos);
void remove(int pos);
void print();
int find(i... | ALGO | 0.998232 | 4.050319 |
105d4b2e-9c18-4385-a692-2eb36f07c19e | thegamer1907/Code_Analysis | DP/1187.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n; cin >> n;
int counterone = 0, maxcount = -1, counter = 0;
while (n--)
{
int i; cin >> i;
if (i)
{
++counterone;
if (counter)
{
-... | ALGO | 0.99998 | 3.990622 |
95d554fd-ce4e-4766-a592-a736cbf09bab | UtopiaXC/CodeSimilarityChecker | CodeSimilarityChecker.cpp | #include "CodeSimilarityChecker.h"
using namespace std;
//全局变量
const char ClassName[] = "CodeSimilarityChecker";//窗口类名
string cpp_keywords[100] = {
"if","int","for","do","new","try",
"asm","else","char","float","long","void",
"short","while","double","break","typedef","register",
"cintunue","catch","signed","unsigned... | TOOL | 0.962998 | 3.527077 |
e563fb85-ab6b-4b7a-a032-1125422b2851 | ChromesDuzez/GameOfFifteen | GameOfFifteen/libraries/boost_1_81_0/libs/geometry/index/example/serialize.cpp | // Boost.Geometry Index
// Additional tests
#include <iostream>
#include <fstream>
#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL
#include <boost/geometry.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <boost/geometry/index/detail/rtree/utilities/statistics.hpp>
#include <boost/archive/binary_oarchive.hp... | TEST | 0.887452 | 6.75366 |
c29a7da8-0739-4cd4-9a91-6ef250a8b457 | tungteg/LapTrinhNangCao | week7/bai2.cpp | #include<iostream>
using namespace std;
void multiply(int* n, int k){
*n = (*n) * k;
}
int main(){
int* n = new int;
int k;
cin >> *n >> k;
multiply(n, k);
cout << *n;
}
| ALGO | 0.999233 | 3.249879 |
42948ddb-6885-4253-b3c7-e386259ffec9 | ishandutta2007/codeforces | dmitriy.belichenko/normal/1076/E.cpp | #pragma GCC optimize("Ofast")
#include <iostream>
#include <map>
#include <vector>
#include <deque>
#include <algorithm>
#include <bitset>
#include <cstring>
#include <math.h>
#include <string>
#include <set>
#include <iomanip>
#include <bitset>
#include <queue>
#include <random>
#include <complex>
#include <random>
#i... | ALGO | 0.999983 | 4.800829 |
d62d3bb5-c80b-4794-9b29-7014fc5caf55 | Mahdi767/Algorithm-Lab-codes | dijkstra.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<int, int>> v[N];
int dis[N];
void dijkstra(int s)
{
queue<int> q;
q.push(s);
dis[s] = 0;
while (!q.empty())
{
int parent = q.front();
q.pop();
for (int i = 0; i < v[parent].size(); i++)
{... | ALGO | 0.999975 | 4.232348 |
5ac968dd-1751-4641-81d8-d368d8a599d4 | hardiksharma2005/DSA | c++ course/linkedlist_removeduplicate.cpp | // remove duplicates-1
// #include <iostream>
// using namespace std;
// class ListNode
// {
// public:
// int val;
// ListNode *next;
// ListNode(int val)
// {
// this->val = val;
// this->next = NULL;
// }
// };
// void insertAtHead(ListNode *&head, int val)
// {
// ListNo... | ALGO | 0.999858 | 5.210256 |
ec274b82-8d85-41dd-81e9-339304dd70cd | ISTE-SS-24-DSA/Pavitra_230957066 | week3/qs5.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to find element in sorted array
// arr: input array
// N: size of array
// K: element to be searche
int searchInSorted(int arr[], int N, int K)
{
// ... | ALGO | 0.999951 | 5.580426 |
ef2f3e1e-dc09-4946-8049-991117ea0414 | wangtongxue-369/xcpc_Code_file | file/codeforces/USST/wuhan_train/2/I.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define INF 0x3f3f3f3f
#define PII pair<ll, ll>
const ll mod = 1e9 + 7;
const ll MAXN = 500005;
const ll base1 = 131;
const ll base2 = 127;
ll _ = 1, n, m, ans = 0, a[MAXN], f[MAXN];
ll x, y;
bool flag = 0;
void dfs(ll c, ... | ALGO | 0.999993 | 4.11864 |
e62bb217-dcef-4da7-9fe0-7bb5e0ac7c8a | hideonatc/uva | 20150526/540.cpp | #include<iostream>
#include<queue>
#include<set>
using namespace std;
int t;
set<int> team[1001];
queue<int> teamlist;
queue<int> plist[1001];
void clearall(void){
for(int i=0;i<1001;i++){
team[i].clear();
while(!plist[i].empty())
plist[i].pop();
}
while(!teamlist.empty())
teamlist.pop();
return;
}
int fi... | ALGO | 0.999603 | 3.539716 |
99a223a6-ee62-4408-9aef-1a443ecaa4f4 | akinhet/SCI_INF | sort.cpp | #include "sort.h"
#include <algorithm>
template<typename T>
inline void swap(T &a, T &b)
{
T c = a;
a = b;
b = c;
}
void printVector(std::vector<int> t)
{
printf("[ ");
for (int i : t)
printf("%d, ", i);
printf("]\n");
}
Sort::Sort()
{
srand(time(NULL));
}
void Sort::randomize(s... | ALGO | 0.998491 | 4.838641 |
3456877f-a482-481a-8a45-93d53cf3e460 | ishandutta2007/codeforces | doped.silicon/normal/1434/B.cpp | // clang-format off
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifndef bhartiya
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx... | ALGO | 0.999983 | 3.593094 |
9082d6da-1df8-4cb8-bf71-c208c0ae6f11 | osirisQdt2810/algorithms | src/leetcode/cheatsheet/solution/0300-0399/0304.Range Sum Query 2D - Immutable/Solution.cpp | class NumMatrix {
public:
vector<vector<int>> s;
NumMatrix(vector<vector<int>>& matrix) {
int m = matrix.size(), n = matrix[0].size();
s.resize(m + 1, vector<int>(n + 1));
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
s[i + 1][j + 1] = s[i + 1][... | ALGO | 0.999701 | 6.662268 |
f30f1841-8c24-423d-bde6-06d007e8a18e | Avichal14/Problem-Of-The-Day | 1627-last-moment-before-all-ants-fall-out-of-a-plank/1627-last-moment-before-all-ants-fall-out-of-a-plank.cpp | class Solution {
public:
int getLastMoment(int n, vector<int>& left, vector<int>& right) {
int t=0;
for(auto l:left){
t=max(t,l);
}
for(auto r: right){
t=max(t,n-r);
}
return t;
}
}; | ALGO | 0.999821 | 5.918067 |
60e296eb-5837-4439-bfe0-8c6e548fc264 | ishandutta2007/codeforces | intercept/normal/1363/F.cpp | #include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define fi first
#define se second
using namespace std;
const int M=2009;
int n;
char s[M],t[M];
int ps[M][26],pt[M][26];
int dp[M][M];
void work(){
scanf("%d%s%s",&n,s+1,t+1);
for(int i=1;i<=n;++i){
for(int j=0;j<26;++j){
ps[i][j]=ps[i-1][j]... | ALGO | 0.999957 | 3.693828 |
31049161-3677-47d3-a689-a3b11cf88813 | ishandutta2007/codeforces | ffao/normal/487/C.cpp | #include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
int n;
int r[1100000];
int ma[1100000];
int main() {
scanf("%d", &n);
if (n == 4) {
printf("YES\n1\n3\n2\n4");
return 0;
}
for (int i = 2; i*i <= n; i++) {
if (n % i == 0) {
printf("NO... | ALGO | 0.999939 | 3.707031 |
bb63a191-3ab0-416a-aa55-4e1ab918be30 | shubhamgyd/mission_TCS | Chegg/182_Linked.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
Node *next; // Pointer to next node
};
struct Node *head = NULL; // Declare Head pointer
struct Node *tail = NULL; // Declare Tail pointer
// Insertion
void insertBegining(int n)
{
struct Node *newNode = new Node;
newNode->data = n;
... | ALGO | 0.998478 | 5.287996 |
99c1bfc1-940f-4d5f-851a-1e6b764b090d | yashtekade21/LeetCode_Solved | 214_Shortest_Palindrome.cpp | class Solution {
public:
string shortestPalindrome(string s) {
long long base =29, mod = (long)1e9+7,fh=0,rh=0,power = 1;
int index = -1;
for(int i=0;i<s.length();i++){
fh = (fh*base + (s[i]-'a'+1))%mod;
rh = (rh + (s[i]-'a'+1)*power)%mod;
power = (power*... | ALGO | 0.999997 | 6.138363 |
61a13852-c035-465a-b6b9-8fee7717d74f | Compiler/AdventOfCode_2024 | Luke/Day8/day8_2.cpp | #include <cctype>
#include <fstream>
#include <functional>
#include <string>
#include <unordered_set>
#include <vector>
#include <unordered_map>
struct Point {
int x, y;
std::size_t operator()(const Point& p) const {
std::size_t h1 = std::hash<int>{}(p.x);
std::size_t h2 = std::hash<int>{}(p.y)... | ALGO | 0.999427 | 5.988436 |
266b7629-ac5e-4ccb-ba9f-87325dba3e6f | mvg01/ps | baekjoon cpp/01269(map).cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
map<int, bool>m;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int a, b, x;
int r1 = 0, r2 = 0;
cin >> a >> b;
for (int i = 0; i < a; i++)
{
cin >> x;
m.insert({ x, true });
}
for (int i = 0; i < b; i++)
{
cin >> x;
... | ALGO | 0.999888 | 3.195465 |
fe6e988e-ce7d-4c2b-a5d7-cdc7a4efe763 | beratallahverdi/CizgeAlgoritmalar | LeetCode0025.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution
{
public:
ListNode *reverseKGro... | ALGO | 0.999992 | 5.656523 |
6dc7ebf3-8844-485b-b206-cc4e7443f71e | kataparus14/struktur-data | Jobsheet 10 Shell adn Quick Sort/Latihan/Quick sort 3.cpp | //Created by Fhandy Nofalino Akhsan 23343065
#include <stdio.h>
#include <stdlib.h>
#define MAX 10
#define MaxStack 10
int Data[MAX]; // = {12,35,9,11,3,17,23,15,31,20};
// Prosedur menukar data
void Tukar (int *a, int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
// Prosedur pengurutan metode Quick Sort
void ... | ALGO | 0.999991 | 4.404981 |
0e5dd181-0fd3-4469-abbf-ce4a6e8ced62 | kushagra0207/Leetcode-Solutions | BST Downward Traversal - GFG/bst-downward-traversal.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// } Driver Code Ends
//User function Templ... | ALGO | 0.999908 | 6.382002 |
996d223c-0fa9-419f-8fd1-1af27cda0e52 | aryav-hash/data-structures | Graphs/RankAndUnion.cpp | #include<bits/stdc++.h>
using namespace std;
class disjointSetUnion{
vector<int> rank, parent;
public:
disjointSetUnion(int n){
rank.resize(n+1, 0);
parent.resize(n+1);
for (int i = 0; i <= n; i++){
parent[i] = i;
}
}
int findUParent(int node){
if (nod... | ALGO | 0.999968 | 4.437549 |
a9930220-7c87-496d-9938-21e9862a0380 | ritikbanger/Hacktoberfest2022-DSA | 20. Dynamic Programming/Longest Palindromic Substring.cpp |
class Solution{
string maxStr = "";
public:
void extendPalindrome(string s, int left, int right){
string sb = "";
while(left>=0 && right<=s.size() && s[left] == s[right])
{
if(left == right){
sb += s[left];
}else{
string l;
... | ALGO | 0.999968 | 5.562635 |
a01e45d8-59bf-4e17-9007-d220e89b3ae2 | heavenMOJANG/ICPC | programmes_C_Cpp/.history/AtCoder/abc418/B_20250809201833.cpp | #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
string s; cin >> s;
int n = s.size();
vector<int> a[26];
for (int i{}; i < n; ++ i) a[s[i] - 'a'].emplace_back(i);
long double maxn{};
for... | ALGO | 0.999256 | 4.628356 |
3c52b44d-e077-4e26-9743-2a8d968a97e5 | shivan1b/codes | oj/sp/ROOTCIPH.cpp | /*
* Created by
* Shivani Bhardwaj <<EMAIL>>
*/
#include<cstdio>
int main()
{
int t;
long long a,b,c,p;
scanf("%d",&t);
while(t--){
scanf("%lld %lld %lld",&a,&b,&c);
printf("%lld\n",a*a-2*b);
}
}
| ALGO | 0.999861 | 4.10034 |
0445bd3e-e91e-4241-af87-61d5691ed053 | Altu-Bitu/Altu-Bitu-Chaerin | 9월 3일 - 정렬/10825.cpp | //
// Created by 김채린 on 2021/09/09.
//
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct info {
string name;
int korean, english, math;
};
bool cmpAdv(const info &i1, const info &i2) {
if (i1.korean != i2.korean) //국어 점수가 다르다면 감소하는 순서
return i1.korean > i2.ko... | ALGO | 0.9996 | 5.04733 |
120c92f5-6008-4815-9944-675b69d53f13 | qwerty2024/LeetCode | easy/704.cpp | class Solution
{
public:
int search(vector<int>& nums, int target)
{
int n = nums.size();
int l = 0;
int r = n;
while (l < r)
{
int mid = l + (r - l) / 2;
if (nums[mid] < target)
{
l = mid + 1;
}
... | ALGO | 0.999915 | 6.033254 |
f1caf566-c9f6-401b-bef4-f66f1f0efdcf | NAGAVENIGOWDA/My_Placement_prep_DSA | Striver's Sheet/DP/frog-jump.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
/*Geek wants to climb from the 0th stair to the (n-1)th stair.
At a time the Geek can climb either one or two steps.
A height[N] array is also given. Whenever the geek jumps from stair i to stair j, the energy consumed
in the jump is abs(height[i]... | ALGO | 0.999975 | 6.167527 |
256d6402-86d5-4931-80c7-607496d52641 | vishwast03/Programming-Problems | Coding Ninjas - CodeStudio/Practice Problems/Easy/duplicate_in_array.cpp | int findDuplicate(vector<int> &arr)
{
int ans = 0;
for(int i = 0; i < arr.size(); i++) {
ans = ans ^ arr[i];
}
for(int i = 1; i < arr.size(); i++) {
ans = ans ^ i;
}
return ans;
}
| ALGO | 0.999584 | 5.100185 |
1c7a6e70-b66f-4faa-bbc2-ebe7422cda76 | Himanshu07-debug/POTD | GFG/Sept/circle-of-strings.cpp | void dfs(int i, vector<int> &vis, vector<int> gr[]){
vis[i] = 1;
for(int x : gr[i]){
if(vis[x] == 0){
dfs(x, vis, gr);
}
}
}
int isCircle(vector<string> &arr) {
// code here
vector<int> gr[26];
vector<int> in(26, 0), out(26, 0);
for(a... | ALGO | 0.99998 | 5.356701 |
a655c581-6489-46ce-ba80-c479d4bf004c | Prakash3023/Cpp-basics | add_nuturalnumber.cpp | #include<iostream>
using namespace std;
int findsum(int n) {
int sum = 0;
for (int i = 1; i <= n; i++) {
sum += i;
}
return sum;
}
int main() {
int n = 7;
cout << "The sumof first"<<n<<"natural number ="<<findsum(n);
return 0;
}
| ALGO | 0.997875 | 4.129001 |
014dcc60-ee2e-493a-92f2-e913e3ec0799 | yuquanw2/cs-233 | Lab12/cachesimulator.cpp | #include "cachesimulator.h"
Cache::Block* CacheSimulator::find_block(uint32_t address) const {
/**
* TODO
*
* 1. Use `_cache->get_blocks_in_set` to get all the blocks that could
* possibly have `address` cached.
* 2. Loop through all these blocks to see if any one of them actually has
* `addr... | ALGO | 0.966773 | 5.648074 |
a512d61a-3490-4f73-83b6-ba4aa9eacb08 | andyyang200/CP | Competitive Programming/Contests/CodeForces/Contests/Rounds/500s/Codeforces Round 570/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(index, start, end) for(int index = start; index < end; ++index)
#define RFOR(index, start, end) for(int index = start; index > end; --index)
#define FOREACH(itr, b) for(auto itr = b.begin(); itr != b.end(); ++itr)
#define RFOREACH(itr, b) qfor(auto itr = b.rbeg... | ALGO | 0.999967 | 3.647845 |
64a0c8b9-0973-43f6-8505-42e4cfd83b92 | gopal-chaudhary/DSA | ENDTERM/BT.cpp | #include<iostream>
#include<list>
using namespace std;
template<typename T>
class node {
public:
T data; // Change int T to T data
node *left, *right;
node(T data) {
this->data = data;
left = NULL;
right = NULL;
}
};
template<typename T>
class Tree {
public:
node<T> *root;
... | ALGO | 0.999816 | 4.930668 |
677ee000-9512-4fcb-b007-d45f9f89f1a4 | heppokoyaro/heppocode | sumitrust2019/mainb.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
using P = pair<int,int>;
using ll = long long;
static const int INF = 1000000000;
static const ll MOD = 1000000007;
ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}
int main... | ALGO | 0.994754 | 3.061045 |
52c49c0f-fa81-4f77-b337-fd6af466fa5f | Astronaut00/Astrocrypt | cryptopp/md2.cpp | // md2.cpp - modified by Wei Dai from Andrew M. Kuchling's md2.c
// The original code and all modifications are in the public domain.
// This is the original introductory comment:
/*
* md2.c : MD2 hash algorithm.
*
* Part of the Python Cryptography Toolkit, version 1.1
*
* Distribute and use freely; there are n... | ALGO | 0.998227 | 6.848805 |
f6e9c5f5-4916-4766-b64b-2debb1c20725 | Glag7/piscine_object | module00/ex01/src/crc.cpp | #include <vector>
#include <stdint.h>
uint32_t crc32(const std::vector<uint8_t>& data) {
static const uint32_t crc_table[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90... | ALGO | 0.979067 | 6.178439 |
4004c7c0-0e2d-4753-9eba-bef370ba9ca7 | omagen9466/Docker_Tut | reg_sims/athena/src/coordinates/minkowski.cpp | // C headers
// C++ headers
#include <cmath> // sqrt()
// Athena++ headers
#include "../athena.hpp"
#include "../athena_arrays.hpp"
#include "../mesh/mesh.hpp"
#include "../parameter_input.hpp"
#include "coordinates.hpp"
//----------------------------------------------------------------------------------------
//! ... | ALGO | 0.99031 | 6.444492 |
da475959-4827-484f-a0df-e788d72173e6 | mpc-msri/EzPC | SCI/src/cleartext_library_fixed.cpp | #include "cleartext_library_fixed.h"
using namespace std;
using namespace sci;
inline int64_t Saturate(int32_t inp) { return (int64_t)inp; }
void cleartext_Sigmoid(int64_t *A, int I, int J, int scale_in, int scale_out,
int bwA, int bwB, int64_t *B) {
int32_t sA = log2(scale_in);
int32_t sB... | ALGO | 0.998817 | 4.291502 |
661a412b-f636-47c4-a762-04c10a95e877 | utkrishta24/DSA | Searching/firstOccurance.cpp | #include <bits/stdc++.h>
using namespace std;
int firstOcc(int arr[], int n, int k)
{
int low = 0;
int high = n - 1;
while (low <= high)
{
int mid = (low + high) / 2;
if (arr[mid] > k)
high = mid - 1;
else if (arr[mid] < k)
low = mid + 1;
else
... | ALGO | 0.999975 | 5.808312 |
3bfa7c2a-570a-4c7b-b590-4f7ad756bc55 | Nanna23/pandemic-simulation | controller/simulation.cpp | #include "simulation.hpp"
#include <stdexcept>
//#include "../model/pandemic.hpp"
//#include "../model/population.hpp"
namespace controller {
controller::Simulation::Simulation(int firstS, int firstI, int firstR,
double beta, double gamma, int t)
: population(firstS, firstI, f... | ALGO | 0.970523 | 5.95494 |
f4ac88cb-50c4-47df-b1f8-b67b2dcae0c3 | NephrenCake/Algorithm | Leetcode/editor/cn/[51]N-Queens.cpp | //The n-queens puzzle is the problem of placing n queens on an n x n chessboard
//such that no two queens attack each other.
//
// Given an integer n, return all distinct solutions to the n-queens puzzle.
//You may return the answer in any order.
//
// Each solution contains a distinct board configuration of the n-... | ALGO | 0.999894 | 6.10603 |
7f039d14-8154-4162-9009-a2313da7d72e | sergantche/TurboStructred | libs/eigen/bench/product_threshold.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
#define END 9
template<int S> struct map_size { enum { ret = S }; };
template<> struct map_size<10> { enum { ret = 20 }; };
template<> struct map_size<11> { enum { ret = 50 }; };
template<> struct ... | TOOL | 0.935581 | 5.099652 |
72f37fc2-f902-4683-9bbd-e9c03179d562 | blitzkriegger0304/frameworks_native | cmds/lshal/TableEntry.cpp | #define LOG_TAG "lshal"
#include <android-base/logging.h>
#include <map>
#include <android-base/strings.h>
#include <hidl-hash/Hash.h>
#include <vintf/parse_string.h>
#include "TableEntry.h"
#include "TextTable.h"
#include "utils.h"
namespace android {
namespace lshal {
static const std::string &getArchString(vin... | TOOL | 0.857085 | 6.757004 |
a9dff9df-3fe2-4d24-b23c-54a1273d5336 | jer22/OI | bzoj/1934/1934.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXV = 10000;
/**
储存弧的结构
代表从from到to,容量为cap, 流量为flow
*/
struct Edge{
int from, to, cap, flow;
};
int V, E, S, T;
vector<Edge> edges; // 边 edges[e]和edges[e ^ 1]互为反... | ALGO | 0.999858 | 3.900199 |
ae48e9cb-8355-4c2d-ad8e-a70c162df90f | Abdelbary/Route-Planner | src/route_planner.cpp | #include "route_planner.h"
#include <algorithm>
RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) {
// Convert inputs to percentage:
start_x *= 0.01;
start_y *= 0.01;
end_x *= 0.01;
end_y *= 0.01;
// TODO 2: Use the m_Model.Fi... | ALGO | 0.976095 | 4.823431 |
9796ffcb-aee4-459b-9737-01a59e070de6 | jeongchans/pmrf | thirdparty/eigen3/bench/benchFFT.cpp | #include <iostream>
#include <bench/BenchUtil.h>
#include <complex>
#include <vector>
#include <Eigen/Core>
#include <unsupported/Eigen/FFT>
using namespace Eigen;
using namespace std;
template <typename T>
string nameof();
template <> string nameof<float>() {return "float";}
template <> string nameof<double>() {r... | TEST | 0.867538 | 6.413768 |
c52a247c-62e6-47fa-8f2c-fdc4af5f5b26 | syahn/Problem-solving | acmicpc.net/10th-day_no_driving_system.cpp | // # Reflection
// There's no need to extract one's digit of number. It was already givien like that.
// # Problem
// 시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
// 1 초 256 MB 1939 1583 1468 83.599%
// 문제
// 서울시는 6월 1일부터 교통 혼잡을 막기 위해서 자동차 10부제를 시행한다. 자동차 10부제는 자동차 번호의 일의 자리 숫자와 날짜의 일의 자리 숫자가 일치하면 해당 자동차의 운행을 금지하는 것이다. 예를 들어, 자동차... | ALGO | 0.999385 | 4.468486 |
a94cb797-35b0-49e3-8449-6b75d3ac4377 | CppOrgSrikanth/CppPrimer | ch16/ex16_20_print_container_iter.cpp | #include <iostream>
#include <vector>
template <typename Container>
std::ostream& print(const Container& c, std::ostream& os = std::cout)
{
for (auto iter = c.begin(); iter != c.end(); ++iter) {
os << *iter << " ";
}
return os;
}
int main()
{
std::vector<int> vec{2, 4, 6, 8, 7, 5, 3, 1};
p... | ALGO | 0.975587 | 5.127322 |
0ffb6d80-b4ec-48a5-ba51-d09c3512722a | gp-b2g/frameworks_base | media/libstagefright/codecs/aacdec/idct8.cpp | /*
Filename: idct8.c
------------------------------------------------------------------------------
REVISION HISTORY
Who: Date: MM/DD/YYYY
Description:
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Int32 x ... | ALGO | 0.999133 | 5.492652 |
a30804ee-74e9-41f4-b146-b8883fb7d234 | khaledatia25/cp-problems-solutions | vjudge-extracted-solutions/UVA/10986/42354334_AC_130ms_0kB.cpp | #include <bits/stdc++.h>
#define KHALED_WALEED_ATTIA ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define space " "
#define endl "\n"
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define ll long long
#define int long long
#define OO 1e18
#define oo 1e9
using namespace std;
void fileInput(... | ALGO | 0.999858 | 5.480237 |
1aa0a0bc-5a4a-4df4-8a65-9edeae98127f | prometheus6011/Cpp_Primer | Chapter 1/Exercises/1_21.cpp | #include <iostream>
#include "Sales_item.h"
int main()
{
Sales_item si1, si2;
std::cin >> si1 >> si2;
std::cout << si1 + si2 << std::endl;
return 0;
} | TOOL | 0.942348 | 4.376859 |
14c623cf-1e5f-4e09-9423-3e1c3c81f7d5 | kk77777/geeksForGeeksSolutions | reverseALinkedList_alt.cpp | // { Driver Code Starts
//Initial Template for C++
// C program to find n'th Node in linked list
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
/* Link list Node */
struct Node
{
int data;
struct Node *next;
Node(int x)
{
data = x;
next = NULL;
}
};... | ALGO | 0.999896 | 5.924725 |
5778c43f-f49c-47bd-8306-50ee701bd12d | StigUK/permission_demo | 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.998809 | 6.763549 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.