uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c89615fd-ff6c-4caa-952c-c7f03c598be4 | dolf-analyst/copied_cpp-base-programming | Chapter_15/deque.cpp | #include <iostream>
#include <deque> // 헤더 파일
int main() {
std::deque<int> deq; // 선언
deq.push_back(10); // 뒤에 추가
deq.pop_back(); // 뒤에 삭제
deq.push_front(20); // 앞에 추가
deq.pop_front(); // 앞에 삭제
deq.resize(10, 0); // 초기화 : 10의 크기만큼 0으로 채움
deq[3] = 10;
std::cout << deq[3] << std::endl;
int nSum = 0;
for(i... | TOOL | 0.898059 | 5.311831 |
074623b1-ffab-49bc-b407-309f60b5750f | olenkisha14/Ejercicios | Sem10.Act4.cpp | #include "pch.h"
#include "iostream"
using namespace System;
using namespace std;
void intercambiar(int& n1, int& n2)
{
int aux;
aux = n1;
n1 = n2;
n2 = aux;
}
void ejercicio_4()
{
int N;
cout << "Ingrese numero de personas: "; cin >> N;
while (N > 100)
{
cout << "Ingrese numer... | ALGO | 0.999557 | 3.195519 |
2cc4e2a1-e4f8-4e07-b9b3-aa379e7fd9c1 | nguyenhoang4875/CompetitiveProgramming | at_coder/abc_342/D.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(a) (int)(a).size()
#define el '\n'
#define F first
#define S second
#define For(i, a, b) for (int i = a; i <= (int)b; i++)
#define Ford(i, a, b) for (int i = a; i >= (int)b; i--)
#defi... | ALGO | 0.999843 | 4.180721 |
f429fe3c-a854-4c51-8cb6-f18d23ac9a3d | OoTMM/Project64-EM | Source/Project64-core/AppInit.cpp | #include "stdafx.h"
#include <Common/path.h>
#include <Common/Trace.h>
#include <Common/Util.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/Plugins/Plugin.h>
#include <Project64-core/N64System/N64Rom.h>
#include <Project64-co... | TOOL | 0.871359 | 4.485529 |
bb268579-8b4a-46c9-a573-a44405f52d2e | kakashih-11/pract | 8_Dictionary_ADT.cpp | /*🔘PROBLEM STATEMET:-
Implement all the functions of a dictionary (ADT) using hashing and handle collisions using
chaining with /without replacement.
Data: Set of (key, value) pairs, Keys are mapped to values, Keys
must be comparable, Keys must be unique
Standard Operations: Insert(key, value),
Find(key), Delete(key)*... | ALGO | 0.998417 | 5.684319 |
98fca1fa-a5f4-4812-a3d4-efe7f372a6ba | tigercosmos/labkit | Source/WebCore/page/ViewportConfiguration.cpp | #include "config.h"
#include "ViewportConfiguration.h"
#include "Logging.h"
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
#include <wtf/text/CString.h>
#include <wtf/text/TextStream.h>
#if PLATFORM(IOS)
#include "PlatformScreen.h"
#endif
namespace WebCore {
#if !ASSERT_DISABLED
static bool constraintsAreA... | TOOL | 0.866661 | 7.498156 |
a758c6fb-c6b5-492a-a425-0cd34479da50 | 101magikarp101/USACO | CodeQuest/checkmate.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <cstring>
#include <bitset>
#include <string>
#include <unordered_map>
#include <deque>
#include <climits>
#include <unordered_set>
using namespace std;
#define ll long... | ALGO | 0.999913 | 5.958691 |
21ef942e-0ef8-48f7-a032-88f5b1847c61 | atharvanaphade/Stash | nagging-react-newbie.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
unordered_map<int,vector<int>>map;
unordered_map<int,int>visited;
int N,M,x,y;
cin>>N;
for(int i=0;i<N;i++)
{
cin>>x;
map[x]={};
}
cin>>M;
for(int i=0;i<M;i++)
{
cin>>x>>y;
map[x].push_ba... | ALGO | 0.999994 | 3.808149 |
63df9443-c162-4b3a-a204-bb0ff9490ce1 | raincross7/code-similarity | codes/train_code/problem203/problem203_95.cpp | #include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> a >> b >> c;
int t = b * c;
if (t >= a) cout << "Yes\n";
else cout << "No\n";
return 0;
}
| ALGO | 0.99986 | 3.839489 |
256c827b-1bd6-4c63-b7fd-c4af32c8cb20 | rakib151p/CodeForces_Solution | B. Special Numbers.cpp | #include<bits/stdc++.h>
using namespace std;
int mx=1e9+7;
long long power(long long n,long long pow)
{
unsigned long long int ans=1;
while(pow)
{
if(pow%2==0)
{
n*=(n%mx);
n%=mx;
pow/=2;
}
else
{
ans*=(n%mx);
... | ALGO | 0.999925 | 4.328711 |
c401d525-a8fc-4b88-b738-cd4696d0b1b3 | TrMTan/Code-CPP-PTIT | c++ tren lop/thuc hanh c++/b3/day con tang dai nhat.cpp | #include<bits/stdc++.h>
using namespace std;
void check(){
int n;
cin >> n;
int a[n], l[n], kq = 0;
for(int i = 0; i < n; i++){
cin >> a[i];
}
for(int i = 0; i < n; i++){
l[i] = 1;
for(int j = 0; j < i; j++){
if(a[i] > a[j]){
l[i] = max(l[i], l[j] + 1);
}
}
kq = max(kq, l[i]);
}
cout << kq... | ALGO | 0.999481 | 4.884749 |
89a5ecbd-9636-4f44-870a-37152233bf27 | 1067147135/Research | ver1/util/graph/directed_graph.cpp | //
// Created by Shixuan Sun on 2020/6/30.
//
#include <fstream>
#include <chrono>
#include <sys/mman.h>
#include <fcntl.h>
#include <vector>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <tuple>
#include <cassert>
#include "directed_graph.h"
#include "util/log/log.h"
void DirectedGraph::load_csr... | ALGO | 0.924368 | 5.541545 |
3065f198-6f57-42de-b4c3-bad3ec307837 | freezerspace/Leetcode | 0070-climbing-stairs/0070-climbing-stairs.cpp | class Solution {
public:
int climbStairs(int n) {
if(n==1)return 1;
if(n==2)return 2;
int a=1,b=2;
for(int i=0;i<n-2;i++){
int c=a+b;
a=b;
b=c;
}
return b;
}
}; | ALGO | 0.999974 | 5.554727 |
9ccf9db7-de9e-4b64-aa18-7ae71bb2849a | RishiKendai/dsa-practice-focused | day3/sorting/selection.cpp | #include <bits/stdc++.h>
using namespace std;
void selection(int arr[], int size) {
for (int i = 0; i < size - 2; i++) {
int min = i;
for (int j = i; j < size - 1; j++) {
if (arr[j] < arr[min]) {
min = j;
}
}
int temp = arr[min];
arr[min] = arr[i];
arr[i] = temp;
}
}
in... | ALGO | 0.999983 | 4.883706 |
30884fb4-5584-4f7c-b198-c8869a65608c | andelkocvjetkovic/PR2 | 2018-02-20-TRANSFUZIJA-KRVI/2018-02-20/2018-02-20.cpp | #include <iostream>
#include <vector>
#include<iterator>
#include<string>
#include<sstream>
#include<thread>
#include<mutex>
using namespace std;
mutex mutObj;
const char* crt = "\n-------------------------------------------\n";
enum OznakaKrvneGrupe { O, A, B, AB };
enum Sortiranje { ASC, DESC };
const char* OznakaKr... | TOOL | 0.95956 | 4.195022 |
019306bf-3d72-41e6-b1d6-a72e4cd57e0e | the3dfxdude/7kaa | src/OAI_DIPL.cpp | //Filename : OAI_DIPL.CPP
//Description: AI functions on diplomacy
#include <OTALKRES.h>
#include <OCONFIG.h>
#include <OTECHRES.h>
#include <ONATION.h>
//----- Begin of function Nation::think_diplomacy -----//
//
void Nation::think_diplomacy()
{
//--- process incoming messages first, so we won't send out the same... | TOOL | 0.97283 | 7.286291 |
77f827d4-f134-4783-a008-f2625f3f98c0 | Adam-Zhou-Hust/NowCoder | 校招真题/2019网易实习生招聘编程题/安置路灯.cpp | // 解题思路
// 一开始,好像很不好确定具体该怎么放置路灯的算法
// 通过画出草图帮助理解
// 首先明确 一盏路灯最多照亮三个位置
// 第二点 不需要照亮的地方也可以放置路灯或者被照亮,但那并不是我们的刻意要求
// 我们始终保证需要照亮的地方必须照亮即可
// 从一个给定的字符串,我们从头开始遍历,找到第一个需要照亮的地方,先不放置路灯灯,考虑从这里开始的连续三个位置的情况
// 可能的情况有 ... .x. ..x .xx 但是其实都只是需要一盏路灯,隔开三个位置后,我们再找到余下的第一个.的位置
// 做如上的同样处理
// 遍历完毕后,得出结果
#include <string>
#include ... | ALGO | 0.999961 | 4.620722 |
fc0dfb51-8cb1-47a6-81fb-9ce78ef5bb9e | heylichen/tpie | doc/olddoc/src/matrix_arithmetic.cpp | AMI_matrix m0(1000, 500), m1(500, 2000), m2(1000, 2000);
AMI_matrix m3(1000, 500), m4(1000, 500);
void f()
{
// Add m3 to m4 and put the result in m0.
AMI_matrix_add(em3, em4, em0);
// Multiply m0 by em1 to get m2.
AMI_matrix_mult(em0, em1, em2);
// Subtract m4 from m3 and put the result in m0... | ALGO | 0.994527 | 3.551617 |
43f961e8-3994-4e79-a01e-e3ac355e5d8a | Shahadat-360/Competitive-Programming | B_AND_Sorting.cpp | // Contest Platform: Codeforces
// Contest Name : Codeforces Round #793 (Div. 2)
// Problem Name : B. AND Sorting
// Author: MD.Shahadat Hossain Bhuian
// Codeforces userName : __Shahadat__
// CodeChef userName : shahadat_43
//---------------------------------------------
// Libary
#include<bits/stdc++.h>
using names... | ALGO | 0.999904 | 5.2985 |
15353ee8-9409-48a8-81a1-328cebc7b936 | hpfem/agros2d | agros2d-library/particle/particle_tracing.cpp | #include "particle_tracing.h"
#include "util.h"
#include "util/xml.h"
#include "util/constants.h"
#include "hermes2d/problem.h"
#include "hermes2d/plugin_interface.h"
#include "util.h"
#include "value.h"
#include "logview.h"
#include "scene.h"
#include "scenebasic.h"
#include "scenenode.h"
#include "sceneedge.h"
#i... | ALGO | 0.999223 | 5.494052 |
b892e136-f288-4fc7-b844-83f9db18ef60 | P-LPI/P-LPI.github.io | code_2D/main.cpp | #include "Header.h"
std::complex<double> func(const pointC p, const pointD mu, const double nu)
{
return I * nu * (pow(p.x - mu.x, 2.) / 2. + pow(p.y - mu.y, 2.) / 2. + phi(p));
}
std::complex<double> phi(const pointC p)
{
return 0.65 / (1. + p.x * p.x + 2. * p.y * p.y);
}
int main(int argc, const char * arg... | ALGO | 0.999607 | 5.248132 |
99fa2f47-d628-4f7c-83a0-acda85909878 | Adit0507/LeetCode | 623-add-one-row-to-tree/623-add-one-row-to-tree.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.999997 | 6.283074 |
f67e0af0-3966-4e63-b3ee-da527e8e8a5a | MouazAlhorani/fit_medicine | 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 |
87afe5e8-8da3-4521-bfcb-1953e9cb5990 | D-Bhatta/Coding | Dynamic_Programming/november/2_Nov_super_ugly_number/2_Nov_super_ugly_number2.cpp | #include<bits/stdc++.h>
using namespace std;
int ugly(int a[], int size, int n){
if(n <= 0){
return 0;
}
if(n == 1){
return 1;
}
priority_queue<int, vector<int>, greater<int>> pq;
for(int i = 0; i < size; i++){
pq.push(a[i]);
}
int count = 1, no;
while ... | ALGO | 0.999987 | 3.648094 |
b9b0736d-9d18-4c73-8fad-c31991f7555c | kavita121/Coding | MaximumRectangularAreaHistogram_GFG_ACCEPTED.cpp | //Maximum Rectangular Area in a Histogram
//GFG ACCEPTED
//Stack and Queue
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
long long getMaxArea(long long arr[], int n)
{
stack<long long> s;
long long temp;
long long maxArea = INT_MIN;
int i;... | ALGO | 0.999742 | 5.582173 |
c3273d04-7f2f-4c4c-bb49-55564e83e7af | absoluteqq/HSEworksPPA | HSEalgs/unordered_tasks/plusandminus.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int evaluateExpression(const string &expression) {
stack<int> chisla;
stack<char> operations;
for (int i = 0; i < expression.length(); i++) {
if (isdigit(expression[i])) {
int val = 0;
while (i <... | ALGO | 0.999904 | 5.441882 |
0f67abf9-43c7-41c8-96b6-0d7d0906dae9 | AFpine/Problem-Solving | BOJ/5000-9999/9249.cpp | #include <bits/stdc++.h>
// 9249 최장 공통 부분 문자열
// update 220702
using namespace std;
typedef long long ll;
typedef pair<long long, long long> pii;
#define x first
#define y second
const int INF = 1e9+5;
const long long llINF = 1e18;
const int minINF = -2e9-1;
const int MAX = 200010;
const long long MOD = 1e9+7;
str... | ALGO | 0.999969 | 4.458796 |
8da69954-3eb3-4464-af2d-ae9ca65208a3 | zyli5313/CareerCup | ch1/temp.cpp | #include <stdio.h>
#include <stdlib.h>
void swap(char **, char **);
int main(void)
{
char str1[100]="This is my String.";
char str2[100]="Another String.";
char *p1=str1;
char *p2=str2;
char **a,**b;
a=&p1;
b=&p2;
printf("1---Address:p1=%p,p2=%p\n",p1,p2);
printf("Before swap:\np1:%s\np2:%s\n",p1... | ALGO | 0.987675 | 3.365996 |
cc6ccdf0-17ef-49c6-8338-32caaa74f526 | SakshiChandrakantpatil/CPP | product bill.cpp | #include <iostream>
#include <string>
class Product {
protected:
int prod_id;
std::string prod_name;
int stock;
double gst;
double discount;
double product_price;
public:
Product(int id, const std::string& name, int stock, double gst, double discount, double price)
: prod_id(i... | TOOL | 0.93699 | 6.879018 |
c4520aa8-4339-4fb8-b6db-166ac0519651 | andreapassini/LearningCpp | GenericFunEx/GenericFunEx/GenericFunEx.cpp | #include <iostream>
using namespace std;
// Generics using template
template<typename T>
// You can also use instead of "typename" - "class"
// & => Passing by reference
void Swap (T& a, T& b){
T temp = a;
a = b;
b = temp;
}
int main(int argc, char* argv[])
{
int a = 5, b = 7;
cout << a << " - "... | ALGO | 0.960109 | 5.130736 |
661525ee-f543-4175-9cfd-178663342af3 | ishandutta2007/codeforces | kmjp/normal/1143/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999961 | 4.160673 |
6b51bb17-7a74-40bd-bcd5-1994f560a57c | Charaf-users/Level-1- | algorithm10/algorithm10.cpp | #include <iostream> // Include iostream for input/output operations.
#include <string> // Include string for potential future use.
using namespace std; // Use the standard namespace to avoid prefixing std:: to standard functions.
// Function: ReadNumbers
// Purpose: Prompts the user to enter three exam marks a... | ALGO | 0.992414 | 5.452428 |
ba3ba9f2-e89e-4783-b391-8322bec7674f | Ayush-Chauhan-7/Competitive-Programming | Graphs/CSES Graphs and Trees/Tree Distances I.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define fo(i, n) for(ll i=0;i<n;i++)
#define vi vector<ll>
#define vp vector< pair <ll,ll> >
#define f first
#define s second
#define pb push_back
#define endl '\n'
using namespace std;
const int mxN = 2e5;
vi adj[mxN], f(m... | ALGO | 0.999831 | 4.357543 |
b5308e25-9048-44ea-bf05-3c82593661d9 | asherikov/eigen_catkin | eigen/unsupported/doc/examples/EulerAngles.cpp | #include <unsupported/Eigen/EulerAngles>
#include <iostream>
using namespace Eigen;
int main()
{
// A common Euler system by many armies around the world,
// where the first one is the azimuth(the angle from the north -
// the same angle that is show in compass)
// and the second one is elevation(the angl... | ALGO | 0.994981 | 4.880029 |
32e52071-2989-4655-933b-e09477c975ff | Amandeepanmol/cpp_practise | Stack/stack_basic.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
stack<int> s;
s.push(89);
s.push(90);
s.push(98);
s.pop();
cout<<s.size()<<endl;
cout<<s.top()<<endl;
s.push(87);
cout<<s.size()<<endl;
while(s.empty()==false)
{
cout<<s.top()<<" ";
s.pop();
}
}
| ALGO | 0.996148 | 3.683074 |
c701a7e4-7fbc-47a8-99cc-79ab476a1e63 | afrozchakure/Competitive-Programming-Solutions | LeetCode/Algorithms/Medium/MatrixBlockSum.cpp | class Solution {
public:
vector<vector<int>> matrixBlockSum(vector<vector<int>>& mat, int k) {
int m = mat.size();
int n = mat[0].size();
vector<vector<int>> sum(m+1, vector<int>(n+1));
for(int r=1; r <= m; r++) {
for(int c=1; c <= n; c++) {
sum[r][c] ... | ALGO | 0.999959 | 6.302329 |
d347169a-ca10-400f-995a-551f2023af18 | cmason145/Secure-Chat-App | src/dh_utils.cpp | #include "../include/dh_utils.h"
#include "../include/common.h" // For base64_* if you like
#include <openssl/bn.h>
#include <stdexcept>
DH *create_dh_params(unsigned int bits)
{
// NID_ffdhe2048 is a standard finite-field group for 2048-bit DH.
DH *dh = DH_new_by_nid(NID_ffdhe2048);
if (!dh)
{
... | ALGO | 0.991253 | 7.198838 |
06f78ae6-2e0a-497b-a202-c6235c5d8e88 | HP657/codetree | 240128/짝수인 것만 출력하기/print-even-number.cpp | #include <iostream>
using namespace std;
int main() {
int n, a;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a;
if (a % 2 == 0)
{
cout << a << ' ';
}
}
return 0;
} | ALGO | 0.999543 | 4.150346 |
37824658-95aa-4ed2-aeb4-1bf85244f508 | sachin6377Tyagi/leetsubmission | 1296-kth-ancestor-of-a-tree-node/kth-ancestor-of-a-tree-node.cpp | class TreeAncestor {
public:
const int N=1e5;
unordered_map<int,vector<int>>adj;
int level[100000];
int table[31][100000];
void dfs(int node,int par,int cnt){
level[node]=cnt;
table[0][node]=par;
for(int i=1;i<31;++i){
if(table[i-1][node]==-1)break;
table[i][node]=table[i-1][tabl... | ALGO | 0.999969 | 5.565806 |
7d4868e7-8775-4dd3-97b6-19a560df35a6 | PoorlyDefinedBehaviour/mysql-user-defined-function-go | mysql-server/extra/icu/icu-release-73-1/source/i18n/sortkey.cpp | //===============================================================================
//
// File sortkey.cpp
//
//
//
// Created by: Helena Shih
//
// Modification History:
//
// Date Name Description
//
// 6/20/97 helena Java class name change.
// 6/23/97 helena Added comments t... | TOOL | 0.991128 | 6.308007 |
f4563402-e3cc-4bc7-bb8d-d45c1cd3c490 | minhphu102003/cph | LGcode/goodNode.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int INF = 1e9+ 5;
vector<vector<int>> tr;
vector<int> a;
pair<int, int> dfs(int node) {
int cho = a[node];
int notCho= 0;
bool flag = false;
int loss= INF;
int len = tr[node].size();
for (int i = 0 ; i< len; i++) {
auto [nc... | ALGO | 0.999938 | 4.037718 |
30f72830-385c-4d59-88a3-74f086f6de36 | zcychar/int2048-2024 | data/Integer2/17.cpp | /*
Time: 2021-10-22
Test: complexity (mul)
Comment: Bonus of A Class
std Time: 0.58s
Time Limit: 2.00s
*/
#include "int2048.h"
sjtu::int2048 a, b;
std::string s1, s2;
int main()
{
for (int i = 1; i <= 10; i++)
{
a = 0, b = 0;
s1 = "", s2 = "";
for (int j = 1; j < 500000; j++)
... | ALGO | 0.999609 | 4.208995 |
76cfacf5-9a53-4306-aff9-21ff76247050 | suraj-raj01/CPP_PROGRAMMING | CPP LANGUAGE/Control_Flow_Statement/HomeWork1/largestNum.cpp | /*
Write a program to find out the largest number between two
*/
#include<iostream>
using namespace std;
int main(){
int a,b;
cout<<"Enter the first number: ";
cin>>a;
cout<<"Enter the second number: ";
cin>>b;
if(a>b){
cout<<a<<" is greater than "<<b<<"\n";
}
else{
cout... | ALGO | 0.997345 | 3.119389 |
07b71106-f6b0-49bc-a4f9-46d685f401ee | wangjula/PostgraduateAdmissionTest | PostgraduateAdmissionTest/PostgraduateAdmissionTest/uva_512_spreadsheet_tracking.cpp | #include "uva_512_spreadsheet_tracking.hpp"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
bool flag = true;
struct Command {
string cmd;
vector<int> p;
};
void InsC(vector<int> &p, int &r, int &c) {
int sz = p[0], dc = 0;
for (int i = 1; i <= sz; ++i) {
if (fla... | ALGO | 0.987712 | 4.65521 |
8746e08f-f8eb-4b2c-8a54-ba83721b2864 | EzraCerpac/CSE_minor_octp | lammps-23Jun2022/src/GPU/pppm_gpu.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing authors: Mike Brown (ORNL), Axel Kohlmeyer (Temple)
------------------------------------------------------------------------- */
#include "pppm_gpu.h"
#include "atom.h"
#include "domain.h"
#include "error.h"... | ALGO | 0.995211 | 6.304007 |
eb9d1616-a743-4efa-b61e-9a42ed8ff335 | hjiang13/LLMs-in-IR | processed_data/DecompiledResuts_Human_x_164_O1/GPT35_Human_x_164_O1_decompiled/test/CPP_1.cpp | ```cpp
#include <vector>
#include <string>
void separate_paren_groups(std::vector<std::string>& result, const std::string& input) {
result.clear();
std::string temp;
for (const char& c : input) {
if (c == '(') {
if (!temp.empty()) {
result.push_back(temp);
... | ALGO | 0.953543 | 6.663865 |
ea8a4d18-cfba-442e-94a2-f7c030efb93d | Garrrruii/BOJ | Graph/BOJ1707 BFS Bipartite.cpp | #include <cstdio>
#include <queue>
using namespace std;
int par[200001];
vector<int> e[200001];
queue<int> Q;
int main() {
int K, V, E;
scanf("%d", &K);
while (K--) {
int a, b;
bool no_bipart = false;
scanf("%d%d", &V, &E);
while (E--) {
scanf("%d%d", &a, &b);
e[a].push_back(b), e[b].push_back(a);
... | ALGO | 0.999978 | 4.840193 |
d204f3b1-fa3c-41a2-88d1-1a0f6e67b0e3 | hsoft-star/CLeetcode | 455. Assign Cookies.cpp | /*
* @lc app=leetcode id=455 lang=cpp
*
* [455] Assign Cookies
*/
// @lc code=start
class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(g.begin(), g.end());
sort(s.begin(), s.end());
int kidi = g.size() - 1;
int cooi = s.size() - 1;
in... | ALGO | 0.999759 | 6.308049 |
bdf9366c-6b89-4e2d-a9e5-70970bc9676d | dDxCg/BaiTap | BT4/9.cpp | #include <iostream>
using namespace std;
bool check(int x1, int y1, int x2, int y2){
if(x1 == x2) return false;
if(y1 == y2) return false;
if (x1 - y1 == x2 - y2) return false;
return true;
}
int main(){
int n;
cin >> n;
int arr[n][2];
for (int i = 0; i < n; ++i){
cin >> arr[i... | ALGO | 0.999944 | 4.635753 |
6b00c9d9-03fc-49b9-b53b-68c7cf1e1b18 | VivekDubey9/-Leetcode-practice | Rat in a Maze Problem - I - GFG/rat-in-a-maze-problem-i.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{
public:
void solve(int row,int col,vector<vector<int> > &maze,int n,vector<string> &ans,
vector<vector<int> > &vis,string str){
/... | ALGO | 0.999913 | 6.591775 |
acb6dd98-2be0-4c86-b56f-37cad024386b | pentium3/2014-ICPC-Regional | pdev/欧拉回路.cpp | /*
⣺ͼŷ·ÿֻһΣ
ŷ·ڣͼֻ0or2ȵĵ㡣
ʱȵĵ㣬Ӹõ㿪ʼԴһ㿪ʼ
̣dfs
ͣ
//
# circuit is a global array
find_euler_circuit
circuitpos = 0
find_circuit(node 1)
---------------------------------------------
# nextnode and visited is a local array
# the path will be found in reverse order
//ݹ麯
find_circuit(node i)
if node i has ... | ALGO | 0.999968 | 3.559928 |
51eb01bf-5fd5-456f-9d88-3d262033e36d | MarcelBruckner-TUMProjects/3D-Scanning-Motion-Capture | Exercise_1/libs/Eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
VectorXf v(2);
MatrixXf m(2,2), n(2,2);
v << -1,
2;
m << 1,-2,
-3,4;
cout << "v.squaredNorm() = " << v.squaredNorm() << endl;
cout << "v.norm() = " << v.norm() << endl;
cout << "v.lpN... | ALGO | 0.998048 | 4.03798 |
292c18bd-7e5c-46c4-983d-1b70382557e4 | JJH123123123/CPP | 7_cpp_.cpp | #include <iostream>
int main(){
int CurrVal = 0, val = 0;
// read first number and ensure that we have data to process
if (std::cin>> CurrVal){
int cnt = 1; // store the count for current value we're processing
while (std::cin >> val) { // read the remaining numbers
if (val =... | ALGO | 0.999577 | 4.386988 |
39110d64-17d2-4dcf-a54b-41ff6a3820dd | walkccc/LeetCode | solutions/3253. Construct String with Minimum Cost (Easy)/3253.cpp | class Solution {
public:
int minimumCost(string target, vector<string>& words, vector<int>& costs) {
const int n = target.length();
// dp[i] := the minimum cost to construct target[0..i)
vector<int> dp(n + 1, INT_MAX);
dp[0] = 0;
for (int i = 1; i <= n; ++i)
for (int j = 0; j < words.size(... | ALGO | 0.999892 | 6.101104 |
d743eb1e-2885-422b-aa20-08e2fdf39bbc | HermanChen/Rockchip_4.1_release_libstagefright | 4.1_jb_release/libstagefright/codecs/amrwb/src/scale_signal.cpp | /*
------------------------------------------------------------------------------
Filename: scale_signal.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------------------------------------------------------... | ALGO | 0.99893 | 5.946876 |
76bee665-231e-42fc-ada7-daeed6c18ec4 | gooldan/newSem | 4.2/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
using namespace std;
const string alphabet = "abcdefghijklmnopqrstuvwxyz0123456789./<=*; ";
const string separators = " ;/<=\n";
const string letters = "abcdefghijklmnopqrstuvwxyz";
const string numbers = "0123456789";
enum states{
number,
fn... | TOOL | 0.975493 | 3.929668 |
31940791-3fd7-41df-8c6c-7aa898daaee1 | Madansingh7/Cpp-DSA | day 3 (loops)/sumodd.cpp | #include<iostream>
using namespace std;
int main(){
int i=1, n, sum=0;
cout<<"\nEnter last number: ";
cin>>n;
while(i<=n){
if(i % 2 != 0){
sum += i;
}
i++;
}
cout<<"Sum of first "<<n<<" odd number is "<<sum;
return 0;
} | ALGO | 0.999544 | 4.2008 |
c67385da-00de-4faf-97eb-c3636d19e74c | andyyang200/CP | Competitive Programming/Contests/USACO/Contests/2013 - 2014/February/Silver/Secret Code/scode.cpp | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include ... | ALGO | 0.999932 | 4.002199 |
3952defb-025c-4fc5-be31-f3c6c3475bfa | gagawjbytw/INAR-rough-Heston | src/classic_Heston_EM.cpp | #include <iostream>
#include <vector>
#include <random>
#include <chrono>
#include <thread>
#include <future>
#include <iomanip>
#include <cmath>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
// Parameter validation function
void validate_parameters(double S0, double V0, double mu, double... | ALGO | 0.999834 | 7.545191 |
c8bdfce1-98fa-44f3-a1f4-afe354d50def | rekongstor/Last-Day-Improvements | src/3rd party/NVTT/src/nvimage/Quantize.cpp | // This code is in the public domain -- <EMAIL>
/*
http://www.visgraf.impa.br/Courses/ip00/proj/Dithering1/floyd_steinberg_dithering.html
http://www.gamedev.net/reference/articles/article341.asp
@@ Look at LPS: http://www.cs.rit.edu/~pga/pics2000/i.html
This is a really nice guide to dithering algorithms:
http://ww... | ALGO | 0.996744 | 6.914302 |
8fe19a9e-cacf-4a18-8383-ab51bed4d000 | FedericoMazzone/secure-vertical-kmeans | src/utils-eval.cpp | #include "utils-eval.h"
usint depth2degree(
const usint depth
)
{
switch(depth)
{
case 3: return 2;
case 4: return 5;
case 5: return 13;
case 6: return 27;
case 7: return 59;
case 8: return 119;
case 9: return 247;
... | ALGO | 0.997247 | 5.53814 |
67169c4e-c10a-4d34-b2c5-5a543ab9f8e6 | sarvex/leetcode-vala | solution/2300-2399/2355.Maximum Number of Books You Can Take/Solution.cpp | using ll = long long;
class Solution {
public:
long long maximumBooks(vector<int>& books) {
int n = books.size();
vector<int> nums(n);
for (int i = 0; i < n; ++i) nums[i] = books[i] - i;
vector<int> left(n, -1);
stack<int> stk;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999993 | 5.515451 |
563bc423-b770-4bd0-bf94-5b6e626528f1 | funcdfs/Algorithm | 2022/1552B找到马拉松比赛中最有可能获得金牌的运动员.cpp | // LINK: https://codeforces.com/contest/1552/problem/B
// NAME: 1552B. Running for Gold, Codeforces - Codeforces Global Round 15
// CODE: https://github.com/fengwei2002, 2022.10.24-21:49:45, 1000 ms
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/dbg.h"
#else
#define dbg(...) 42
#endif
int ... | ALGO | 0.999951 | 4.976436 |
fb5e2f28-ecdc-446d-89ec-a21c17227f06 | AbhijeetAnand45/DSA_Basics | Programs/BackTracking/N_Queens_Problem.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool isSafe(int row, int col, vector < string > board, int n) {
// check upper element
int duprow = row;
int dupcol = col;
// diagonal checking
while (row >= 0 && col >= 0) {
if (board[row][col] == 'Q')
... | ALGO | 0.999808 | 5.875577 |
a3d09f08-aaff-4a35-a7ba-42c8a4278d3d | Mridul-1-Sharma/Hacktoberfest2022-DataStructuresAndAlgorithms | Dynamic Programming/lcs.cpp | /* Dynamic Programming C++ implementation of LCS problem */
#include <bits/stdc++.h>
using namespace std;
/* Returns length of LCS for X[0..m-1], Y[0..n-1] */
int lcs(char *X, char *Y, int m, int n)
{
// intitalizing a matrix of size (m+1)*(n+1)
int L[m + 1][n + 1];
/* Following steps build L[m+1][n+1] in... | ALGO | 0.999982 | 6.01451 |
69938509-8e55-4e81-a1cb-eadd1cf59732 | Mohamed-Elhabashy/competitive-programming | Codeforces/496/A.cpp | #include<bits/stdc++.h>
using namespace std;
const long long N=1e6;
int d(){
int ret;
scanf("%d",&ret);
return ret;
}
long long lld(){
long long ret;
scanf("%lld",&ret);
return ret;
}
int arr[300];
int main(){
int n=d();
for(int i=0;i<n;i++){
scanf("%d",arr+i);
}
if(n==... | ALGO | 0.999883 | 3.765465 |
ff1abbad-7658-496b-a867-55d387c2aeb7 | Koyingtw/CP | Codebook-master/Geometry/Geometry.cpp | //Copy from Jinkela
const double PI=atan2(0.0,-1.0);
template<typename T>
struct point{
T x,y;
point(){}
point(const T&x,const T&y):x(x),y(y){}
point operator+(const point &b)const{
return point(x+b.x,y+b.y); }
point operator-(const point &b)const{
return point(x-b.x,y-b.y); }
point operator*(const T &b)const... | ALGO | 0.999846 | 3.015671 |
120690b8-4615-4bc1-9869-f79899cb3fdf | sarvex/leetcode-lua | solution/0400-0499/0454.4Sum II/Solution.cpp | class Solution {
public:
int fourSumCount(vector<int>& nums1, vector<int>& nums2, vector<int>& nums3, vector<int>& nums4) {
unordered_map<int, int> cnt;
for (int a : nums1) {
for (int b : nums2) {
++cnt[a + b];
}
}
int ans = 0;
for (int... | ALGO | 0.999965 | 6.397081 |
3e86402d-bc9b-4ce5-940d-e0b5c27fa169 | endo1322/AtCoder | abc/abc326/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; (i) < (int)(n); ++ (i))
#define rep3(i,m,n) for (int i = (m); (i) < (int)(n); ++ (i))
#define rrep(i,n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define rrep3(i,m,n) for (int i = (int)(n) -... | ALGO | 0.999874 | 4.620617 |
fb9fe901-5fc0-45f0-9ac0-f5eebe6fc746 | stack-queue-coder/CP-DSA | young physicist.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n;
cin >> n;
int x , y , z;
int ansx = 0 ,ansy = 0, ansz = 0;
while(n--){
cin >> x >> y >> z;
ansx += x;
ansy += y;
ansz += z;
}
(ansx == 0 and ansy == 0 and ansz == 0) ? cout<<"YES" : cout<<"NO";
return 0;
}
| ALGO | 0.999746 | 3.862526 |
fa1e3691-88fc-4f29-bed4-d238c20fed79 | PurplePup/Reword | reword/random.cpp | ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
#include "random.h"
#include <ctime>
CRandom::CRandom(void)
{
rseed = 1;
mti=CMATH_N+1;
}
// Returns a number from 0 to n (excluding n)
unsigned int CRandom::Random( unsign... | ALGO | 0.986662 | 5.477468 |
5f7a0990-4c7d-484a-86b3-fb0a82e33c7b | AmirKobaisse/automanger-car-dealership | 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 |
8554995b-f0e9-4e31-849c-f5db07601b58 | ksah3756/Algorithm | 프로그래머스/2/155651. 호텔 대실/호텔 대실.cpp | #include <bits/stdc++.h>
using namespace std;
// 10:37
// 퇴실 후 10분간 청소를 해야 함
int solution(vector<vector<string>> book_time) {
int answer = 0;
map<int, int> m;
int minute, hour;
for(const vector<string>& times : book_time) {
minute = stoi(×[0][3]);
hour = stoi(times[0].substr(0, 2)... | ALGO | 0.997323 | 5.182703 |
cd16d03f-b658-4a31-bc69-df1ba2b8be73 | yun0529/Algorithm_study | test/ct_prac/ct_prac/softeer7726.cpp | #if 0
#include<iostream>
#include <queue>
#include <tuple>
#include <algorithm>
using namespace std;
int n, m, n_visited[1004][1004], g_visited[10][1004][1004];
char arr[1004][1004];
//bool flag = false;
vector<pair<int, int>> ghost;
//pair<int,int> wall;
pair<int, int> nam;
pair<int, int> door;
int dy[] = { -1,0,1,... | ALGO | 0.999931 | 4.415283 |
2859b9f5-a070-4f96-98db-df4f33d75c13 | imtahirabatool/Leetcode | 539-minimum-time-difference/minimum-time-difference.cpp | class Solution {
public:
int findMinDifference(vector<string>& timePoints) {
int ans = INT_MAX;
vector<int> minutes;
for (const string& time : timePoints) {
minutes.push_back(timeToMinutes(time));
}
sort(minutes.begin(), minutes.end());
for (int i = 1; ... | ALGO | 0.999732 | 6.426535 |
e4e4005c-554f-48c4-8a16-2bb4b363c87c | PAVITHRA786786/TrainingCpp | Assignments/day38/prg03.cpp | /*
std::forward_list<string> – Chat History Cleanup
📌 Problem: Clean Deleted Messages
In a messaging app, each message is stored in a std::forward_list<string>.
Messages that start with "DELETED:" must be removed.
Implement a cleaner that:
Traverses the list
Removes all "DELETED:" prefixed messages
🧾 Input:
["Hi", ... | TOOL | 0.983601 | 7.232717 |
ee172d7f-0393-4b26-ba3d-55f379e1e0bc | syntheticpp/blitz | examples/tiny2.cpp | #define BZ_DISABLE_KCC_COPY_PROPAGATION_KLUDGE
#include <blitz/tinyvec-et.h>
using namespace blitz;
typedef TinyVector<double,3> vec;
inline void reflect(vec& reflection, const vec& incident,
const vec& surfaceNormal)
{
// The surface normal must be unit length to use this equation.
reflection = incid... | ALGO | 0.997704 | 4.712124 |
c8e5ddc2-5492-4805-a0f2-ac0d52f49fbf | 1dagord/leetcode-solutions | Solutions/Cpp/bitwise_and_of_numbers_range.cpp | /*
[MEDIUM]
201. Bitwise AND of Numbers Range
Concepts:
- bit manipulation
Stats:
Runtime | 0 ms [Beats 100%]
Memory | 11.35 MB [Beats 13.33%]
*/
class Solution {
public:
int rangeBitwiseAnd(int left, int right) {
/*
For every set number represented ... | ALGO | 0.999909 | 6.363604 |
977636a8-c1b8-4da1-b862-9738c68af23b | C0DER11101/CPP_Games | GameTut/TicTacToe/Game.cpp | #include<iostream>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
#include "Game.h"
#include "GamePlay.cpp"
int main(void)
{
string name1, name2;
char sym1, sym2;
int dim, turn=0;
cout<<"**Welcome to Tic-Tac-Toe**\n\n";
cout<<"\n\nEnter dimensions for the board: ";
cin>>dim;
cout<<"Enter name of pla... | ALGO | 0.943343 | 4.093405 |
8b53fb18-1faa-45bb-a768-6a17b7047be5 | SecretSantaApps/SecretSantaFlutterApp | 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.998859 | 6.785645 |
1e58376a-d01e-49a9-a823-69d05835ac67 | patpro28/maketest | custom/digit001/gen/max_test.cpp | #include <iostream>
#include <vector>
#include <climits>
#include "random.h"
#include "../params.h"
using namespace std;
const int MIN = 1 << 10;
int main(int, char* argv[]) {
int seed = atoll(argv[1]);
auto gen = Random(seed);
int t = 1000;
cout << t << endl;
for(int i = 0;i < t;i++){
i... | TEST | 0.960006 | 3.175281 |
b2754586-e628-48c0-adcf-4284dc27dcdd | touyou/CompetitiveProgramming | aoj/0064.cpp | #include <sstream>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int add(string s) {
int num = 0;
string tmp = "";
for (int i=0; i<s.length(); i++) {
if (isdigit(s[i])) {
tmp += s[i];
} else if (!tmp.empty()) {
stringstream ss;
ss.str(tmp);
int t; ss ... | ALGO | 0.999126 | 4.330238 |
7ccfdef7-0fe8-4cfd-8804-6505e4be780e | ejspeiro/HackerRank | all_domains/tutorials/cracking_the_code_interview/queues_a_tale_of_two_stacks.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
class MyQueue {
public:
stack<int> stack_newest_on_top, stack_oldest_on_top;
void push(int x) {
if (stack_newest_on_top.empty()) {
... | ALGO | 0.998754 | 4.609141 |
0be724b0-d542-4769-a8dd-0abd573f8cf8 | ilvcr/SourceCode | opencv-4.2.0/modules/photo/src/hdr_common.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "hdr_common.hpp"
namespace cv
{
void checkImageDimensions(const std::vector<Mat>& images)
{
CV_Assert(!images.empty());
int width = images[0].cols;
int height = images[0].rows;
int type = images[0].type();
for(size_t i = 0; i < images.s... | TOOL | 0.96411 | 5.92583 |
f95959e9-657c-40ec-b8e9-d34e0f2fb4c4 | xinyiqian97/DEM | lib/atc/TransferLibrary.cpp | // ATC headers
#include "TransferLibrary.h"
#include "ATC_Coupling.h"
#include "PrescribedDataManager.h"
#include "LinearSolver.h"
#include "PerAtomQuantityLibrary.h"
#include "KernelFunction.h"
#include "MoleculeSet.h"
//#include <typeinfo>
#include <set>
#include <sstream>
#include <utility>
#include <vector>
using... | TOOL | 0.886718 | 5.296975 |
922b757d-8ebf-4e7b-9f27-b601e8b261fc | saifali2501/C-assignment. | display matrix.cpp | #include<iostream>
using namespace std;
class matrix{
int a;
int b;
int A[3][3];
public:
void readmatrix();
void displaymatrix();
};
void matrix::readmatrix()
{
for(int i=1;i<=3;i++)
{
for(int j=1;j<=3;j++)
{
cout<<"A["<<i<<"]["<<j<<"] :";
cin>>A[i][j];
}
}
}
void matrix::displaymatrix()
{
for(... | ALGO | 0.885694 | 3.143419 |
f1474dca-8393-4d16-9bd9-dd0ce1a7887b | shihabul-islam-shihab/Data-Structure | Vector all.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int>vct;
int x,n;
cin>>n;
for(int i=0;i<n;i++){
cin>>x;
vct.push_back(x);
}
vct.push_back(99);
vct.push_back(999); //add elements
vct.pop_back(); //delete vector elements
vct.at(0)=0; //upda... | ALGO | 0.999941 | 3.647467 |
fc5d0092-86c3-4d4e-ada8-85d815cdb670 | Penzo00/Smith-Waterman | smith-waterman.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include "smith-waterman.h"
#define S_LEN 512
#define N 1000
double get_time() // function to get the time of day in seconds
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec + tv.tv_usec * 1e-6;
}
int max4(int n1, int n2,... | ALGO | 0.999699 | 3.841561 |
18bf0a51-33ff-4101-96a5-84ac31866493 | antoine-trux/regex-crossword-solver | source/solver/hexagonal_grid.cpp | #include "hexagonal_grid.hpp"
#include "grid_line.hpp"
#include "hexagonal_grid_printer.hpp"
#include "regex_crossword_solver_exception.hpp"
#include "utils.hpp"
#include <algorithm>
#include <cassert>
#include <iterator>
using namespace std;
namespace
{
// Return 'regexes' grouped by line, such that each group of... | ALGO | 0.969624 | 6.922518 |
67427845-3b71-43fe-9e9e-19b26c16337e | xdd44-utopia/acm | 143.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Edge {
Edge(int s, int t, int w) {
from = s;
to = t;
weight = w;
}
int from, to, weight;
};
int n, m;
int father[200];
vector<Edge> edges;
int find(int i) {
int p = father[i];
while (p != father[p]) {
p = father[p];
... | ALGO | 0.999976 | 4.651268 |
8c9ff9a4-dee6-4f7b-a7b0-f759f504428a | lisa-wolfgang/Vessel-Browser | source/other-licenses/7zstub/src/CPP/Common/TextConfig.cpp | // Common/TextConfig.cpp
#include "StdAfx.h"
#include "TextConfig.h"
#include "UTFConvert.h"
static inline bool IsDelimitChar(char c)
{
return (c == ' ' || c == 0x0A || c == 0x0D || c == '\0' || c == '\t');
}
static AString GetIDString(const char *s, unsigned &finishPos)
{
AString result;
for (finishPos =... | TOOL | 0.933825 | 5.997059 |
89fd1e32-585b-4610-828d-c3d6ea84c13c | abufarhad/Codeforces-Problems-Solution | 1152A Neko Finds Grapes.cpp | //! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) scanf... | ALGO | 0.999946 | 3.147552 |
21a010a6-6899-434a-b3c3-3f621a3800bc | satyam15/Coding | CODECHEF/CR193.cpp | // A Lucas Theorem based solution to compute nCr % p
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
ll fac[1001];
void factorial()
{
fac[0]=1;
fac[1]=1;
for(ll i=2;i<=1000;i++)
fac[i]=((i%mod)*(fac[i-1]%mod)%mod);
}
ll power(ll x, ll y, ll p)
{
ll r... | ALGO | 0.99999 | 4.557828 |
8624ee67-edf8-4808-8e4e-cd79618ca4c1 | skyto0927/Programming-Contest | 100+50Problem/020.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;
int main() {
int N;
cin >> N;
vector <... | ALGO | 0.999968 | 4.056686 |
30fd418c-8e91-46d7-9cc6-4be743db38c7 | Parc-Ferme/LeetCode | 637-average-of-levels-in-binary-tree/637-average-of-levels-in-binary-tree.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.999944 | 6.871661 |
ac6e4e9f-2741-4787-9887-0b7fd044af64 | nioomeee/Sem-3-Assignments | OOPS/assignment 5/7.cpp | // Write a C++ program to take a account no, balance and withdraw amount. If amount is less
// than balance then raise an exception.
// Note : If exception is raised, user need to enter withdraw amount again till the exception
// resolves.
#include<iostream>
using namespace std;
class Solution{
public:
};
int main()... | TOOL | 0.907987 | 4.605596 |
6844e521-f77b-4279-8f5c-79dd544feefb | pramenku/asan-hip-samples | examples/GPU-STREAM/RAJAStream.cpp | #include "RAJAStream.hpp"
using RAJA::forall;
using RAJA::RangeSegment;
template <class T>
RAJAStream<T>::RAJAStream(const unsigned int ARRAY_SIZE, const int device_index)
: array_size(ARRAY_SIZE)
{
RangeSegment seg(0, ARRAY_SIZE);
index_set.push_back(seg);
#ifdef RAJA_TARGET_CPU
d_a = new T[ARRAY_SIZE];
... | ALGO | 0.969572 | 6.075105 |
18a5f0fc-0a36-45c9-b7c9-f20d514fe1e8 | kylin0925/online_judge | acm/c100/acm151.cpp | /* @JUDGE_ID: 53xxxx 151 C++ */
#include <stdio.h>
int k;
int test(int c)
{
int pos,wk=k;
int i,arr[300],len=k;
pos=0;
for(i=0;i<k;i++)
{
arr[i]=i+1;
}
while(wk>1)
{
for(i=pos+1;i<len;i++)
{
arr[i-1]=arr[i];
}
wk--;
len--;
pos=(pos... | ALGO | 0.999944 | 3.488644 |
4c9c6888-ec7a-4b25-8f0b-4b36588811b4 | chipbuster/protein-stability | protein-tools/ideal-chain/archive/traj_visualizer/deps/libigl/python/py_igl/py_forward_kinematics.cpp | //m.def("forward_kinematics", []
//(
// const Eigen::MatrixXd& C,
// const Eigen::MatrixXi& BE,
// const Eigen::MatrixXi& P,
// std::vector<Eigen::Quaterniond, Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
// std::vector<Eigen::Vector3d> & dT,
// std::vector<Eigen::Quaterniond, Eigen::aligned_allocator<Eig... | TOOL | 0.991823 | 5.875387 |
7dfef395-4447-4fc7-aef0-c6a23b16a4b4 | ishandutta2007/codeforces | pinkrabbit/normal/587/D.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
const int MN = 50005, MM = 50005;
int N, M, eu[MM], ev[MM], ec[MM], et[MM], Cnt, mxt;
std::vector<int> G[MN], _H[MM * 6]; const auto H = _H + MM * 3;
inline void ins(int x, int y) { H[x].push_back(y); }
inline void insw(int x, int y) { ins(x, y), ins(-y, -x); ... | ALGO | 0.999978 | 3.874729 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.