uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
6ea648ba-dec3-460f-a1e6-86e2dbf1d3a3 | alexandraback/datacollection | solutions_5644738749267968_0/C++/zhangbo/main.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <functional>
using namespace std;
void calc()
{
static int caseno = 0;
caseno++;
int n;
cin >> n;
vector<double> v1(n... | ALGO | 0.999962 | 3.87904 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb0e50ec5... |
af0c4880-e387-4dde-a3d4-2181906541d2 | caofengl/record | OJ/LeetCode/494_target_sum.cpp | #include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution {
public:
int findTargetSumWays(vector<int>& nums, int s) {
int res = 0;
findTargetSumWays(nums, s, 0, res);
return res;
}
void findTargetSumWay... | ALGO | 0.999967 | 5.886715 | {
"github_metadata": {
"branch": "master",
"commit_count": 203,
"repo_created_at": "2017-11-14T08:43:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "273c1585... |
d209d8ee-8a94-4eb8-b2c0-bbc984ae4b24 | objLew/HackerRank-Solutions | Interview-Prep/RepeatedString.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the repeatedString function below.
long repeatedString(string s, long n) {
long result = 0;
long intoS = 0;
long numA = 0;
long extraA = 0;
long pos;
intoS = n/s.size();
if(n > s.size()){
for(long i = 0; i < s.size(); i++)... | ALGO | 0.998981 | 3.990856 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2017-11-16T22:47:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a80f132... |
29a63bfc-d5ff-48b0-bf4a-f6bb039448f4 | ImanolFotia/Epsilon-Engine | core/engine/scene/structs/frustum.hpp | #pragma once
#include "box.hpp"
#include <list>
#include <glm/glm.hpp>
#include <array>
#include <core/common/common.hpp>
#include "sphere.hpp"
#include <core/framework/containers/static_array.hpp>
namespace engine
{
class Frustum
{
public:
// Call this every time the camera moves to update the frustum
voi... | ALGO | 0.982879 | 6.484049 | {
"github_metadata": {
"branch": "master",
"commit_count": 1303,
"repo_created_at": "2019-04-02T20:27:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 59,
"forks": 3,
"issues": 2,
"pull_requests": 6
},
"file_meta": {
"content_id": "6e67f3... |
1dd81b1d-1703-472c-8cd0-dacd0a5f2846 | sendoru/problem_solving | source/boj/9465.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int max(int a, int b)
{
return a > b ? a : b;
}
void dp(vector<pair<int, int>> stickers, vector<pair<int, int>>& sum)
{
sum[0].first = stickers[0].first;
sum[0].second = stickers[0].second;
sum[1].first = stickers[0].second + sticke... | ALGO | 0.999981 | 4.487478 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2021-05-01T19:31:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "172cb840673... |
bdd78398-aed7-47ad-9b1e-059e372a6842 | qtumproject/qtum | src/libff/libff/algebra/scalar_multiplication/multiexp.hpp | /** @file
*****************************************************************************
Declaration of interfaces for multi-exponentiation routines.
*****************************************************************************
* @author This file is part of libff, developed by SCIPR Lab
* and con... | ALGO | 0.939181 | 6.472267 | {
"github_metadata": {
"branch": "master",
"commit_count": 46429,
"repo_created_at": "2017-03-03T08:17:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1215,
"forks": 404,
"issues": 37,
"pull_requests": 3
},
"file_meta": {
"content_id": "1... |
7e77f6f2-b026-4439-97d2-9679e6cf6b4b | RedBrean/term2 | term4/PCoding/gatherv_rand/smth/katya.cpp | #include <mpi.h>
#include <stdio.h>
#include <cmath>
#include <stdlib.h>
#include <fstream>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int rc;
rc = MPI_Init(&argc, &argv);
if (rc != MPI_SUCCESS) {
printf ("Error starting MPI program. Terminating.\n");
MPI_Abort(MPI_COMM_WOR... | ALGO | 0.998219 | 3.479449 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2024-02-01T07:57:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9385e1c6a2... |
7c6deb05-149d-4af1-af62-d0a059fecb01 | raghavaggarwal99/Competitive | Codeforces/912B.cpp | #include<bits/stdc++.h>
typedef long long int ll;
#define pair<ll,ll> pii;
using namespace std;
ll maxXorSum(ll n, ll k)
{
// If k is 1 then maximum
// possible sum is n
if (k == 1)
return n;
// Finding number greater than
// or equal to n with most significant
// bit same as... | ALGO | 0.999985 | 4.296899 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2020-04-15T19:19:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b1b58054... |
322bf335-64f1-4970-9593-0376d592c91d | aanchalsethi/DataStructuresAndAlgorithm | linkedlist/insert.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
void InsertAtHead(Node *&head, int d)
{
// create a new node
Node *temp = new Node(d);
temp->next = head;
head = temp;
}
... | ALGO | 0.999703 | 5.10439 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-07-10T14:52:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cde76f7b450... |
b22b903d-968a-44aa-b746-f9c5b64433bd | sidcatch/FINAL450 | heap/merge-k-sorted-arrays.cpp | #include <climits>
#include <iostream>
#include <queue>
#include <vector>
#define N 4
using namespace std;
struct MinHeapNode
{
int element;
int i;
int j;
};
struct CompareNode
{
bool operator()(const MinHeapNode &a, const MinHeapNode &b)
{
return a.element > b.element;
}
};
vector<... | ALGO | 0.999957 | 5.154553 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2023-02-07T10:18:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eae09da52d... |
b4adeb85-2852-47d6-b6b1-6fd03218fad7 | szcompressor/SZ3 | tools/sz3/deprecated/test_huffman_coding.cpp | #include "SZ3/encoder/HuffmanEncoder.hpp"
#include <vector>
#include <iostream>
using namespace std;
int main() {
const int N = 65536;
const int capacity = 1024;
std::vector<int> type(N);
for (int i = 0; i < N; i++) {
type[i] = rand() % capacity;
}
unsigned char *compressed = (unsigne... | TOOL | 0.956475 | 3.9543 | {
"github_metadata": {
"branch": "master",
"commit_count": 574,
"repo_created_at": "2020-11-29T01:08:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 93,
"forks": 40,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "fc3bb5... |
29c18116-bd97-4355-9426-2a29d95c9c32 | gggh000/dev-learn | cpp/globalvar.cpp | /*
This program exemplifies the use of global variable, firstNumber and secondNumber declared
outside the main(). Once it is declared outside main() function, it is global and can be
used both inside main and multiplyNumber functions.
*/
#include <iostream>
using namespace std;
// three global integers;
int firstNum... | TOOL | 0.976625 | 3.301698 | {
"github_metadata": {
"branch": "master",
"commit_count": 557,
"repo_created_at": "2020-04-05T08:03:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6ebad658... |
588bd5ce-f7fe-4215-954a-6582e3880ea1 | SandUniHH/CIW | Exercises/Descriptors/MoleculeSimilarity.cpp | #include <iostream>
#include "Naomini/Forward.hpp"
#include "Naomini/Molecule.hpp"
#include "Naomini/MoleculeFactory.hpp"
#include "Naomini/Helpers.hpp"
#include "ExtendedConnectivityFingerPrint.hpp"
#include "SimilarityMeasure.hpp"
namespace Naomini{
void analyseMoleculeSimilarity(MoleculeVector molecules,
unsi... | ALGO | 0.993049 | 4.733507 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-05-12T13:45:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db2d8f3ab6... |
04c06459-b1e3-4f80-8cf1-dde6d678af52 | yousefkotp/CPU-Scheduling-Algorithms | main.cpp | #include <bits/stdc++.h>
#include "parser.h"
#define all(v) v.begin(), v.end()
using namespace std;
/** Global Constants **/
const string TRACE = "trace";
const string SHOW_STATISTICS = "stats";
const string ALGORITHMS[9] = {"", "FCFS", "RR-", "SPN", "SRT", "HRRN", "FB-1", "FB-2i", "AGING"};
bool sortByServiceTime(... | ALGO | 0.999941 | 3.766643 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2022-11-07T13:06:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 145,
"forks": 57,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a474f3a5... |
80ca851b-8820-4e6e-baac-8ab2fcd58417 | ishandutta2007/codeforces-s | saketh/normal/461/C.cpp | #include <iostream>
using namespace std;
int N, Q, T, A, B;
int bit[100005];
int dir = 1, sta = 0;
int read(int k){
int sum = 0;
while(k > 0){
sum += bit[k];
k -= (k & -k);
}
return sum;
}
void update(int i, int v){
while(i <= N){
bit[i]+=v;
i += (i & -i);
}
}
... | ALGO | 0.999338 | 3.862678 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26280661c062... |
cd3ee24b-2780-41dc-9130-f5088930c222 | FallingStar624/GSDS3_Algo | kyubyungchae/BOJ/0x02/2309.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int num[9], result[7];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
for(int i = 0; i < 9; i++) cin >> num[i];
for(int a = 0; a < 8; a++) {
int total = 0;
for(int b = a + 1; b < 9; b++) {
total = 0;
... | ALGO | 0.999458 | 3.942843 | {
"github_metadata": {
"branch": "main",
"commit_count": 1008,
"repo_created_at": "2022-03-30T08:56:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b4e43ee9... |
8d1b5f0b-4aca-4a86-babb-974f7f61c16f | seo-bo/ProblemSolving | 백준/contest/32194.cpp | #include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef long double lb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll>ti;
const char* yes = "Yes";
const char* no = "No";
int main(void)
{
cin.tie(0)->ios::sync_with_stdio(0);
int n = 0;
cin... | ALGO | 0.999953 | 3.67489 | {
"github_metadata": {
"branch": "main",
"commit_count": 2731,
"repo_created_at": "2025-01-09T04:45:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "014140f29... |
4543c9fb-6a79-4ebb-af92-d0bd1a7f1e51 | rohakdebnath/CodeForces-Solutions | boringday.cpp | // #include <bits/stdc++.h>
// using namespace std;
// using i64 = long long;
// void solve() {
// int n, l, r; cin >> n >> l >> r;
// vector<int> a (n); for (int i = 0; i < n; ++i) cin >> a[i];
// i64 ans = 0, s = 0;
// int j = 0;
// for (int i = 0; i < n;) {
// while (j < n and s < l) {
... | ALGO | 0.999937 | 5.627037 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-17T12:11:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ece73ba9f... |
025176c5-6bb8-4adc-aea5-5ca2280812a3 | andreax79/ServerlessNabaztag | compiler/vcomp/compiler_prog.cpp | //-------------------
// MV
// version WIN32 et POCKETPC
// <NAME>
// Derniere mise a jour : 07/01/2003
//
#include <stdio.h>
#include <string.h>
#include "param.h"
#include "terminal.h"
#include "memory.h"
#include "parser.h"
#include "prodbuffer.h"
#include "compiler.h"
#include "interpreter.h"
int Compiler::pars... | ALGO | 0.92506 | 3.29023 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2012-12-01T07:18:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 80,
"forks": 31,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0d86886f... |
2e00562c-4884-4b0a-8a4a-93c45a4083fc | yubincho3/baekjoon | 11191&13709.cpp | #include <bits/stdc++.h>
using namespace std;
long long arr[100001];
int n;
long long solve()
{
int row = 0;
// 입력 최댓값인 10^18은 60자리 2진수
for (int b = 59; b >= 0; b--)
{
// 현재 행의 b 자리가 1이 아니라면
if (~arr[row] & 1ull << b)
{
bool doesntExist = true;
for (in... | ALGO | 0.999999 | 4.590884 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-02-28T06:41:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a6a6c2ec57... |
32d86dde-95cd-4466-8d6f-7852cd22b805 | goish135/LL-1-Parser | readnstore.cpp | #include<iostream>
#include<fstream>
#include<cstring>
#include<string.h>
#include<vector>
using namespace std;
struct CFG {
string rule;
string nt;
vector<string> t;
};
int main()
{
printf("Input file name:(xxx.txt) or exit the program(exit):");
string filename;
while(cin>>filename)
{
if(filename=="exi... | TOOL | 0.99077 | 3.426561 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2017-12-08T17:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f2cc53b6... |
e8fc0afa-ba04-48fd-99a5-02f8e7694922 | shenyih0ng/aoc | 2020/Day-18/operation_order.cpp | #include <boost/multiprecision/cpp_int.hpp>
#include <iostream>
#include <stack>
#include <aocdefault.h>
using namespace std;
using namespace boost::multiprecision;
template <typename T>
ostream& operator<<(ostream& out, stack<T>& s) {
stack<T> copy = s;
out << "----T" << endl;
while (!copy.e... | ALGO | 0.999795 | 4.777351 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2021-01-04T15:02:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1753dc327d... |
a1f3bfd4-a9e0-4bb9-b0cb-5ebf03f973b5 | YIFNEN/CPP2409 | project/week9/tictactoe_func.cpp | #include <iostream>
using namespace std;
const int numCell = 3; // 보드판의 가로 세로 길이
char board[numCell][numCell]{}; // 보드판을 나타내는 2차원 배열
int isValid(int x, int y) {//좌표의 유효성을 확인하는 함수
int checkinvalid = 1;
if (x >= numCell || y >= numCell || x < 0 || y < 0) {// 좌표 범위를 벗어날때
cout << x << ", " << y << ": x와 y 둘 중 하나가 칸을 벗... | ALGO | 0.987508 | 3.946423 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-09-09T06:14:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41f18a0bd03... |
9a95f531-84dc-47f1-931d-63ce5a4e66d3 | mfep/midiconn | src/PlatformUtilsWin.cpp | #include "PlatformUtils.hpp"
#include <array>
#include <codecvt>
#include <locale>
#include <sstream>
#include <stdexcept>
#include <string>
#include "SDL2/SDL.h"
#include "SDL2/SDL_syswm.h"
#include "spdlog/spdlog.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <shellapi.h>
#include <shellscalingapi.h>... | TOOL | 0.959374 | 6.976615 | {
"github_metadata": {
"branch": "main",
"commit_count": 382,
"repo_created_at": "2023-04-22T20:28:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40c9ebd63... |
c41c2744-386a-4073-8ac6-22f84738e0c5 | CFOnHeart/ReversiServer | ReversiClient-mac/ReversiClient-mac/Train.cpp | //
// Train.cpp
// ReversiClient-mac
//
// Created by ganjun on 2018/5/18.
// Copyright © 2018年 ganjun. All rights reserved.
//
#include "Train.h"
Train::Train(){}
void Train::readModel(char *model_name){
FILE * fr = fopen(model_name, "r");
char buffer[1000];
black_win_rate.clear();
white_win_ra... | DATA | 0.93434 | 3.998233 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2018-03-02T07:51:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf8d58d08... |
4a54bf84-8c02-4c74-81b4-111c97164cca | Kartoffelecke/OncoSimul | OncoSimulR/src/exprtk.h | /*
******************************************************************
* C++ Mathematical Expression Toolkit Library *
* *
* Author: <NAME> (1999-2019) *
* URL: http://www.partow.net/programming/exprtk/in... | TOOL | 0.917155 | 5.096294 | {
"github_metadata": {
"branch": "freq-dep-fitness",
"commit_count": 1899,
"repo_created_at": "2020-01-12T11:02:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id"... |
2bb93bf2-6033-4372-bc53-388f9868ffde | Juwita14/8-puzzle-DFS | 8_puzzle_DFS.cpp | #include <bits/stdc++.h>
#define Right 6
#define Left 4
#define Up 2
#define Down 8
#define F first
#define S second
using namespace std;
struct Node {
int state[3][3];
Node *par; //parent
int move; //2 - up, 4 - left, 6 - right, 8 - down
int nn;
};
stack<Node*> s;
list<int> path;
int in[10], fin[10], fin... | ALGO | 0.999955 | 3.571348 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-04-08T12:59:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e44714c28... |
b99509a1-472f-41b1-88f7-c750ff9cff85 | Tarunagg1/Ds_Alog_notes | Last_Digit_of_Nth_Fibonacci_Number/Last_Digit_of_Nth_Fibonacci_Number.cpp | //C++ Program to find last digit of nth fibonacci numbers
#include<iostream>
using namespace std;
int main() {
int a[60], n, i;
a[0] = 0;
a[1] = 1;
//Using the concept that after 60 numbers in a fibonacci numbers the last digit repeats itself again and again
for(i = 2 ; i < 60 ; i++ ){ //for... | ALGO | 0.999596 | 4.049191 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T04:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fafdeb39c8... |
b5d64fdd-35de-4401-bd80-2f63fc402699 | alexandraback/datacollection | solutions_5648941810974720_0/C++/acguy/main.cpp | #include<iostream>
using namespace std;
/*
G EIGHT
H THREE
W TWO
U FOUR
Z ZERO
X SIX
O ONE
S SEVEN
V FIVE
E NINE
*/
int c[30];
int d[10];
void del(int n, string s){
while(n--){
for(int i = 0;i<s.size();i++){
c[s[i]-'A']--;
}
}
}
void p(){
for(int i = 0;i<10;i++){
... | ALGO | 0.999718 | 3.478534 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92370bb3e... |
d01b1822-4998-4197-8302-cfdea4c5e718 | QbitQuantum/Basics | Исходники/bvh4_builder_fast.cpp | void BVH4BuilderFast::createLeaf(BuildRecord& current, Allocator& nodeAlloc, Allocator& leafAlloc, size_t threadIndex, size_t threadCount)
{
#if defined(DEBUG)
if (current.depth > BVH4::maxBuildDepthLeaf)
throw std::runtime_error("ERROR: depth limit reached");
#endif
/* create leaf f... | ALGO | 0.995408 | 5.70288 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f388feb3540... |
4fe0629c-af68-4421-aa72-8d05ca3865bb | dakotath/carhorn | include/miniz.h | #ifndef MINIZ_EXPORT
#define MINIZ_EXPORT
#endif
/* miniz.c 3.0.0 - public domain deflate/inflate, zlib-subset, ZIP
reading/writing/appending, PNG writing See "unlicense" statement at the end
of this file. <NAME> <<EMAIL>>, last updated Oct. 13,
2013 Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and... | TOOL | 0.909466 | 6.661307 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-07-13T14:30:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac7564c53bc... |
7e366d2c-5cb6-4548-9655-4f3dd118f702 | faxinwang/OJ_PAT | 2 advance/1-20/1009. Product of Polynomials (25).cpp | /*
1009. Product of Polynomials (25)
时间限制
400 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
<NAME>
This time, you are supposed to find A*B where A and B are two polynomials.
Input Specification:
Each input file contains one test case. Each case occupies 2 lines, and
each line contains the information of a polynomi... | ALGO | 0.997862 | 3.609746 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-07-26T13:27:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5ee1529c... |
52f5b990-0ce4-41f4-9027-5439717a4c52 | chency-june/HDOJ_my_answer | 2032.cpp | #include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
const int maxn = 15 * 31;
int arr[maxn];
//calculate
for (int i = 0; i < 30; i++) {
arr[i * (i + 1) / 2] = 1;
for (int j = 1; j < i; j++) {
arr[i * (i + 1) / 2 + j] = arr[i * (i - 1) / 2 + j - 1] + ... | ALGO | 0.999914 | 3.445409 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-03-03T02:03:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcba73492... |
f87d9779-16fa-4f76-8f08-5582d15444a0 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/minimum-time-to-revert-word-to-initial-state-ii-Solution.minimumTimeToInitialState/177827_nan.cpp | static struct posix_acl *jffs2_get_acl(struct inode *inode, int type)
{
struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
struct posix_acl *acl;
char *value = NULL;
int rc, xprefix;
switch (type) {
case ACL_TYPE_ACCESS:
acl = jffs2_iget_acl(inode, &f->i_acl_access);
if (acl != JFFS2_ACL_NO... | ALGO | 0.926003 | 5.573628 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2d99c9565a6... |
1ca0f6bb-f3b2-44ae-a743-f23f55775e56 | briansenas/OpenGLProgram | operate.cc | #include "operate.h"
/*****************************************************************************//**
*
*
*
*****************************************************************************/
_vertex3f _operate::normalize(_vertex3f v){
float length = sqrt(v._0*v._0 + v._1*v._1 + v._2*v._2);
return _vertex3f(v... | ALGO | 0.983167 | 4.504457 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-04-18T18:51:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d96f64fabaaf... |
864d1853-afc8-4ba8-afe1-cc73df289720 | alevitskii/cpp-learning | learncpp/ch16/quiz/16.6_1-4.cpp | #include <cstddef>
#include <iostream>
#include <limits>
#include <optional>
#include <vector>
template<typename T> void printArray(const std::vector<T>& arr)
{
for (std::size_t i{ 0 }; i < std::size(arr); ++i) { std::cout << arr[i] << ' '; }
if (std::size(arr) > 0) { std::cout << '\n'; }
}
template<typename T> T... | ALGO | 0.991889 | 5.583125 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-08-11T16:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01b42dbe32c... |
f3415a9f-a29e-4b91-acc7-743401efcb4c | zhenglu0/Programming_Practice | Practices/Arrays/Search2DArray.cpp | //
// Search2DArray.cpp
//
// Created by 罗铮 on 12/11/12.
// Copyright (c) 2012 罗铮. All rights reserved.
#include <iostream>
#include <iomanip>
using namespace std;
void PrintMatrixSequencially(int **A, int r, int c)
{
for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
cout << ... | ALGO | 0.999348 | 5.025095 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-13T14:48:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67f3bd06dd... |
1ba1bf09-7650-44e0-b871-e1f7fa1bd34e | yimo22/Baekjoon | 7569.cpp | #include <iostream>
#include <queue>
using namespace std;
int N,M,H;
const int dir[6][3] = {{0,1,0},{0,0,1},{0,-1,0},{0,0,-1},{1,0,0},{-1,0,0}};
int matrix[100][100][100];
int visited[100][100][100];
int answ = 0;
struct Node{
int x;
int y;
int z;
int cnt;
};
queue<Node> q;
void Solved(){
int x,y,z,cnt;
wh... | ALGO | 0.999936 | 3.80529 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2021-01-24T02:24:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d63a1535... |
4c14a75b-1e38-480f-867a-9b5f548c84e5 | artemohanjanyan/university | 4_term/dm/02/F.cpp | #include <bits/stdc++.h>
int const maxn = 400001;
int const alph = 'z' - 'a' + 2;
int shift[maxn], ord[maxn], count[maxn];
int newShift[maxn], newOrd[maxn];
using std::cin;
using std::cout;
int main()
{
std::ifstream cin("count.in");
std::ofstream cout("count.out");
std::string s;
s.reserve(maxn);
cin >> s;
s... | ALGO | 0.9999 | 3.791596 | {
"github_metadata": {
"branch": "master",
"commit_count": 249,
"repo_created_at": "2016-05-05T23:55:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 2,
"pull_requests": 4
},
"file_meta": {
"content_id": "6d40fe79... |
b53a54f4-f23f-4062-b6a6-73fa3b502615 | ishandutta2007/codeforces-t | timmyfeng/normal/542/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 201;
int f[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> f[i];
}
long long cycle = 1, ans = 1;
for (int i = 1; i <= n; ++i) {
ma... | ALGO | 0.999956 | 3.770186 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6eb0c8a3888... |
23d89999-f1ec-4b49-8c7a-67bb4b9cb99c | pixaut/MediSick | WithOutLearning/ProcessTest.cpp | #include "..\Library\NeuronNetwork.h"
#include <fstream>
#include <utility>
#include <algorithm>
/* programm that process test */
int main(){
std::ifstream fin;
int n,c,layers;
char gender;
const char *InOut = "..\\Telegram s... | DATA | 0.995814 | 3.727535 | {
"github_metadata": {
"branch": "main",
"commit_count": 227,
"repo_created_at": "2023-08-20T19:18:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ae7600916... |
650e749f-ff2c-4185-b9c8-8b1f3aa2ea6e | majedop/Cpp-and-Data-structure | Week 5 Recap/Mo 18 Lab Mid Exam/Practics.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
double data;
Node *next;
};
class Singly_linked_list
{
public:
Node *head;
int sz;
Singly_linked_list()
{
head = NULL;
sz = 0;
}
// New Node return
Node *Creat_node(double value)
{
Node *newNode = new Node;
newNode-... | ALGO | 0.994541 | 3.856224 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-21T18:37:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5664ffaf2f59... |
ca1d5c00-0434-4ea0-a0c7-e79ab4ea9d78 | lidianxiang/leetcode_CPP | 树/94-二叉树的中序遍历.cpp | /*
给定一个二叉树的根节点 root ,返回它的 中序 遍历。
示例 1:
1
\
2
/
3
输入:root = [1,null,2,3]
输出:[1,3,2]
示例 2:
输入:root = []
输出:[]
示例 3:
输入:root = [1]
输出:[1]
示例 4:
1
/
2
输入:root = [1,2]
输出:[2,1]
示例 5:
1
\
2
输入:root = [1,null,2]
输出:[1,2]... | ALGO | 0.999997 | 6.046684 | {
"github_metadata": {
"branch": "master",
"commit_count": 551,
"repo_created_at": "2020-10-19T01:43:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c551fac... |
140b3d0c-770e-4432-90f5-817399c0d45b | TheMartian0x48/Data-Structure-and-Algorithm | Algorithms/Graph/single_source_shortes_path/bellman_ford.cpp | /**
* @author: <NAME>
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
using namespace std;
struct Edge{
int u, v, w;
Edge(int a, int b, int c) : u{a}, v{b}, w{c}{}
};
int INF = INT_MAX, n, m;
vector<Edge> g;
vector<int> predecessor, dis;
void BellmanFord(int s) {
m = g.size()... | ALGO | 0.999987 | 4.139692 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2020-05-19T23:27:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfa3e84af... |
f8b5a1bc-cc5e-4ab1-bc9e-556328b09b02 | Programmesto/Algorithms_practice | Task_1_3.cpp | #include <iostream>
#include <string>
#include <cmath>
std::string normalizeText(std::string text)
{
std::string normString;
for (size_t i = 0; i < text.length(); i++)
{
if (isalpha(text[i]))
{
normString.push_back(tolower(text[i]));
}
}
return normString;
}... | ALGO | 0.999549 | 4.70803 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-09-24T06:32:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc7526f098c1... |
3ace2957-e427-4c33-b3c4-b1bdf615ef91 | caando/Competitive-Programming-Archive | Codeforces/1486C2/solution.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
#define fi first
#define se second
#define sz(c) ((int)(c).size())
#define all(c) (c).begin(), (c).e... | ALGO | 0.999972 | 3.025528 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2021-05-28T12:03:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6458a5259f... |
bdca57fc-7a86-494c-80b7-1d6d538192ae | devyaniChoubey/My-Solutions-DS-Algo | DP/Knapsack/ Last Stone Weight II.cpp | https://leetcode.com/problems/last-stone-weight-ii/description/
// Same problem as:
// Divide all numbers into two groups,
// what is the minimum difference between the sum of two groups.
// Now it's a easy classic knapsack problem.
stones array = [a, b , c, d];
For any sequence of operations, the algebra boils down... | ALGO | 0.99746 | 5.033053 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2023-07-01T03:49:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bd8f41a14... |
3f81b88a-76dd-4461-b7cb-5b2e211abdbb | ansonn/esl_systemc | systemc_regressions-2.3.1/tests/systemc/misc/synth/gcd/gcd.cpp | /*****************************************************************************
The following code is derived, directly or indirectly, from the SystemC
source code Copyright (c) 1996-2014 by all Contributors.
All Rights reserved.
The contents of this file are subject to the restrictions and limitations
set f... | ALGO | 0.99404 | 6.41072 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-05-11T15:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d63d676... |
77c6ba2f-3aa4-428a-b8ef-efc6974cd275 | asilajdzic/Tehnike-Programiranja | IspitniZadaci2/PovezanaListaZadaca21.cpp | // TP 2018/2019: Zadaća 3, Zadatak 5
#include <iostream>
#include <new>
#include <vector>
struct Blok {
int redni_broj;
Blok *sljedeci;
};
std::vector<int> Razbrajanje(int N, int M)
{
std::vector<int> izlazni;
// kreiranje povezane liste
Blok *pocetak = nullptr;
Blok *prethodni;
for (int i ... | ALGO | 0.997731 | 4.40297 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-14T18:05:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c69aa9d2a254... |
2deba9b5-365c-4148-968d-c016ee46e1de | patrick-burasan24/pbinfo | DFS_ITERATIV.cpp | // Algoritmul descris mai jos foloseste o stiva efectiva pentru realizarea parcurgerii in adancime
// a grafului. Nota: pentru garantarea ordinii crescatoare, se va folosi un set.
#include <fstream>
#include <vector>
#include <stack>
#include <set>
using namespace std;
ifstream fin("dfs.in");
ofstream fout("dfs.out")... | ALGO | 0.999991 | 4.627862 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2023-06-12T11:37:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f34f11e7d8b... |
b0749694-aaad-45cb-adf3-488abedc971f | raskarabhi45/Supreme-Batch | Array3.cpp | //Doneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
// Sunday 12/2/23 @12pm
// 2d arrays
#include<iostream>
#include<vector>
#include<limits.h>
using namespace std;
//linear mapping index at linear=c*i+j; c=number of columns i=row index j=col index
//n rows index= 0 to n-1;
//m col index= 0 to m-1
// VECTOR ... | ALGO | 0.99959 | 3.627924 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2023-04-09T11:45:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bd294703... |
f5271dee-fe0e-4d7d-809b-f023aca64328 | PuddingPengChen/Magic3D | CuraEngine3/src/utils/SparseGrid.h | //Copyright (c) 2016 <NAME>
//Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef UTILS_SPARSE_GRID_H
#define UTILS_SPARSE_GRID_H
#include "IntPoint.h"
#include <cassert>
#include <unordered_map>
#include <vector>
#include <functional>
namespace cura {
/*! \b... | ALGO | 0.997663 | 6.021083 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-06-02T07:40:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "de8c4e5... |
74661911-083f-4dde-93aa-a0be4dd07767 | zaidurrohmaan/UVa-Online-Judge-Solutions | 11221 - Magic square palindromes.cpp | #include <bits/stdc++.h>
//#include <string>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
int main()
{
int n;
string s;
cin >> n;
cin.ignore();
for(int tc = 1; tc <= n; tc++){
getline(cin, s);
int len = s.length();
... | ALGO | 0.999629 | 4.070519 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2023-01-15T04:37:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "020868c316... |
770a1e02-e7c9-455d-abe1-d511e7745fc0 | Bouchet07/myfish | src/moves.cpp | #include <iostream>
#include "moves.h"
#include "tt.h"
#include <cstring>
#include <algorithm>
MoveList generate_moves(Board &board){
MoveList move_list;
move_list.reserve(256);
//move_list.count = 0;
Square source_square, target_square;
Bitboard attacks, bitboard;
for (PieceType piece = PAWN;... | ALGO | 0.972781 | 5.067755 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2023-08-09T10:13:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f4ab597875... |
2543b78f-24ae-40eb-88f6-43e3b3997839 | regisb/onbnn | src/lshkit-onbnn/lshkit/lsh-index.h | /*
Copyright (C) 2008 <NAME> <<EMAIL>>. All Rights Reserved.
This file is part of LSHKIT.
LSHKIT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(... | ALGO | 0.998263 | 6.751014 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2012-12-03T11:19:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4cdf80cf... |
b84af7da-a830-423f-826d-a16ad4b9bd59 | Muxelmann/DiCOMO | DiCOMO/resistor.cpp | //
// resistor.cpp
// DiCOMO
//
// Created by <NAME> on 09.06.13.
// Copyright (c) 2013 <NAME>. All rights reserved.
//
#include "resistor.h"
Resistor::Resistor(complex<double> vcc, complex<double> vss) : Element(vcc, vss) {
// Defines element as Resistor
_elementType = RESISTOR;
// Setup impedan... | ALGO | 0.940338 | 6.238638 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2013-06-26T22:15:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b7f214f3e... |
df379888-474d-4848-928e-5a37e5a5515b | zhyDaDa/CPP_Learning | questions/leetcode/permutations-ii.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
int len = 0;
vector<vector<int>> result;
void swap(vector<int> &nums, int a, int b)
{
nums[a] = nums[a] ^ nums[b];
nums[b] = nums[a] ^ nums[b];
nums[a] = nums[a] ^ nums[b];
}
void process(vector<int> &nums,... | ALGO | 0.999995 | 5.31234 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-07-24T15:48:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e96adc99946... |
c804e73a-a8c6-462a-aa4b-2fd039da81a7 | adityajamwal02/LeetcodeProblemSet2 | PartitionArrayIntoTwoArraysToMinimizeSumDifference.cpp | /*
You are given an integer array nums of 2 * n integers. You need to partition nums into two arrays of length n to minimize the absolute difference of the sums of the arrays. To partition nums, put each element of nums into one of the two arrays.
Return the minimum possible absolute difference.
Example 1:
example-1
I... | ALGO | 0.999987 | 5.953275 | {
"github_metadata": {
"branch": "main",
"commit_count": 335,
"repo_created_at": "2023-05-07T06:18:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a8e2a68ad... |
2767b28b-64bc-4577-906f-811f324bf0c6 | Master-Helix/DSA-Graphs_Important_Codes | DSU_Implementation(Union_by_Rank_and_Path_Compression).cpp | #include <bits/stdc++.h>
using namespace std;
#define fast() ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define ll long long
#define l long long
// IMPLEMENTATION OF DISJOINT SET UNION WITH union by rank and Path Compression
int parent[1000];
int rank[1000];
void makeSet(int n)
{
for(int i=0;i<=n;i+... | ALGO | 0.999943 | 4.956417 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-06T16:56:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e71d53b7ea87... |
4c099e29-1815-44bc-b802-13da5e57b162 | schwehr/pfmabe | Libraries/utility/spline_cof.cpp |
/*********************************************************************************************
This is public domain software that was developed by the U.S. Naval Oceanographic Office.
This is a work of the US Government. In accordance with 17 USC 105, copyright protection
is not available for any work o... | ALGO | 0.999931 | 4.907366 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-03-07T16:54:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ef693df54... |
d9103adf-fb12-48d3-9c4a-4a389d1d6e5c | Rockroyal305/Practice-Problems | MAX-Mex.cpp | #include <iostream>
using namespace std;
int main()
{
int tests;
cin >> tests;
for(int t = 0; t < tests; t++)
{
int answer = 0, MEX[100000], length;
string binary_string_1, binary_string_2;
cin >> length >> binary_string_1 >> binary_string_2;
for(int i = 0; i < length;... | ALGO | 0.999736 | 3.925917 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-01T04:00:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b87b8a17ffb... |
dafa1583-7f6a-43ae-885a-373ade7a9b06 | gabriel-araujjo/model-checker-benchmarks | concurrent-hashmap/testcase3.cc | #include <threads.h>
#ifdef WILDCARD
#include "hashmap_wildcard.h"
#else
#include "hashmap.h"
#endif
HashMap *table;
void printKey(Key *key) {
if (key)
printf("pos = (%d, %d, %d)\n", key->x, key->y, key->z);
else
printf("pos = NULL\n");
}
void printValue(Value *value) {
if (value)
printf("velocity = (%d, %... | ALGO | 0.958052 | 4.852675 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2021-02-07T16:14:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84734cd195... |
9cf49133-f96c-4651-832d-6b4c902e8400 | bryanSME/hipparchus-_cpp | ode/nonstiff/RungeKuttaFieldIntegrator.h | #pragma once
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "Licens... | ALGO | 0.997905 | 5.136236 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-08-15T23:45:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "561ca2f224c... |
56c0410a-f7ae-423e-abed-df00d3e5d95c | Maurya-Grover/Competitive_Coding | Hackerrank/Algorithms/Greedy/mark_and_toys/solution.cpp | #include <bits/stdc++.h>
#define newline cout << "\n"
#define pb push_back
#define mp make_pair
#define rep(i, a, b) for (int i = a; i < b; i++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,... | ALGO | 0.999959 | 3.927553 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-08T09:40:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a544be0c38... |
55e901f4-9e23-4590-adba-7c14f85489ff | Josmateussilva0110/CODE_FORCES | Hungry.cpp | #include <bits/stdc++.h>
#define optimize ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define INF 1000000010
#define INFLL 1000000000000000010LL
#define ll long long
#define ld long double
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define os_type int
#define PB push_back
#d... | ALGO | 0.998483 | 4.176831 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-01-10T12:05:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "994e8b8ad... |
eba62252-5a56-4005-82a8-c17a0f4ca5c3 | ThatGuy91011/FunWithFiles | Source.cpp | #include <iostream>
#include <fstream>
#include <string>
int keywords, reserved;
int main()
{
//Creating a variable to hold the original file
std::fstream file;
//Strings to hold each individual word of the file and the name of the file
std::string word, filename;
//Variable to hold the output file
std::ofstrea... | TOOL | 0.980798 | 3.775724 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-01-28T23:15:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82b424b092... |
966917d3-2248-4b29-9076-0b8eefa45708 | koponomarenko/prata-cpp-6th-edition | chapter_06/task_07.cpp | /*
Write a program that reads input a word at a time until a lone q is entered. The
program should then report the number of words that began with vowels, the num-
ber that began with consonants, and the number that fit neither of those categories.
One approach is to use isalpha() to discriminate betwee... | ALGO | 0.996037 | 4.423915 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2016-10-31T07:51:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "360240131... |
0cf928db-1489-478c-b0e7-5c13260fda4d | AIFM-sys/AIFM | aifm/DataFrame/original/include/DataFrame/Internals/DataFrame_get.tcc | // <NAME>
// September 12, 2017
/*
Copyright (c) 2019-2022, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of ... | TOOL | 0.928008 | 7.586598 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-10-12T02:03:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 122,
"forks": 37,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "681da29... |
f7ac1c93-6441-4a1d-99b3-15d0f9a90f93 | uni-kakurenbo/cp-solutions | realtime/AtCoder/abc262/d.cpp | /*
* @uni_kakurenbo
* https://github.com/uni-kakurenbo/competitive-programming-workspace
*
* CC0 1.0 http://creativecommons.org/publicdomain/zero/1.0/deed.ja
*/
/* #language C++ GCC */
/* #region tmplate */
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL_JUDGE
#include<debug>
#define debug(...... | ALGO | 0.999975 | 4.273645 | {
"github_metadata": {
"branch": "main",
"commit_count": 262,
"repo_created_at": "2022-07-23T02:32:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2dd0fd28a... |
c44efbda-9460-4142-8ae5-baeb55bfaccb | infikei/algorithm | baekjoon_all/02000+/boj_2702.cpp | // Solve 2022-09-15
// Update 2025-03-03
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define SIZE(v) (int)v.size()
#define ALL(v) v.begin(),v.end()
#define SETW(n, c) cout << setw(n) << setfill(c);
#define SETP(n) cout << fixed << setprecision(n);
using namespace std;
usin... | ALGO | 0.999944 | 5.801089 | {
"github_metadata": {
"branch": "main",
"commit_count": 1613,
"repo_created_at": "2022-05-22T18:51:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8f5350fd... |
b79fd104-b459-4dde-8fd1-455c64d71787 | xyzzyz/Game-Of-Life | source/Simulator.cpp | #include "Simulator.h"
bool Simulator::isStopped = false;
int Simulator::turn = 0;
int Simulator::fIncrease(Map &map, int n) {
return n < map.squaresAmount - 1 ? n + 1 : 0;
}
int Simulator::fDecrease(Map &map, int n) {
return n > 0 ? n - 1 : map.squaresAmount - 1;
}
int Simulator::fCounter(Map &map, int x, int ... | TOOL | 0.924111 | 4.6836 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-05-24T18:40:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f77fc408... |
468c34df-5914-46a3-8194-771de1632654 | shishirkumar1996/cp | 18/04.18/12.04.18/701C.cpp | #include<bits/stdc++.h>
#define lld long long int
#define vi vector < lld >
#define vii vector < vi >
using namespace std;
int compare(vi a,vi b){
for(int i = 0;i<a.size();i++){
if(a[i]<b[i])
return -1;
}
return 1;
}
int calc(int n,string input){
vii process;
vi counter;
map< char, int > pr... | ALGO | 0.999965 | 3.756022 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2018-04-13T04:44:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ffd5ef0... |
ea185984-5720-4294-ac4f-4f8f98cca3f9 | tai3804/c | CTDL>/lab3/lab3_them.cpp | #include <bits/stdc++.h>
#include <stdlib.h>
typedef struct Node{
int value;
Node *next;
} Node;
typedef struct List{
Node *head;
Node *tail;
} List;
void makeEmptyList(List &l){
l.head = NULL;
l.tail = NULL;
}
int size(List l){
int cnt=0;
while (l.head != NULL) {
cnt++;
l.head = l.... | ALGO | 0.999938 | 3.817465 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-10T15:51:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db6cf758e442... |
18a473b6-c8c8-4cec-8a7b-79b7789ba15f | VictorLutes/competitive-programming | UVA-10810.cpp |
#include <iostream>
#include <cstdio>
using namespace std;
//faz o merge das duas sub listas usando o vetor temp para armazenar os dados ordenados para contar o número de inversões
long merge(int *vet, int *temp, int l, int mid, int r){
//printf("%d - %d - %d \n", l, mid, r);
//defina um contador
int i=l... | ALGO | 0.999041 | 3.57748 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-17T14:51:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "270dba22a771... |
c3589ec2-eaec-4616-9099-76d565276ee8 | wetits/InformatiqueGraphique | main.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#include <iostream>
#include <random>
//#include <omp.h>
std::default_random_engine generator;
std::uniform_real_distribution<double> dist... | ALGO | 0.977908 | 3.066736 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-29T22:39:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "413c08800903... |
344d4f12-a4cb-4390-b9a3-f11a0937910c | raincross7/code-similarity | codes/train_code/problem206/problem206_24.cpp | /*
*
* Author: r3gz3n
* 3b 13 12 9 56 4e
* 6 56 a a 5f f
* 6 56 47 18 56 d
* 13 46 14 1f 13 27
* 52 52 a 5a 47 1
* 1d 13 b 1b 49 17
*
*/
#include <utility>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <c... | ALGO | 0.995155 | 3.589432 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd8d9146cd2e... |
5375d31f-ebdc-40c7-b012-e323d1202788 | Aditya-aka-leo/Leet-Code-Grind | Boundary Traversal of binary tree - GFG/boundary-traversal-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999657 | 5.937191 | {
"github_metadata": {
"branch": "main",
"commit_count": 412,
"repo_created_at": "2022-05-06T08:29:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4d30c5c5f... |
a6b85fc6-78a9-4749-bc77-1975f79a55c2 | dsanchezs23/DotsGame-v-2.0 | CloseStrategy.cpp | #include "CloseStrategy.h"
CloseStrategy::CloseStrategy(){
}
CloseStrategy::~CloseStrategy(){
}
std::string CloseStrategy::getName(){
return "Close strategy";
}
bool CloseStrategy::executeStrategy(GameField*& gameField){
Movement movement = checkPossibilityToMakeASquare(gameField);
if (movement.getColumn() ==... | ALGO | 0.991254 | 3.631681 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-03-04T04:53:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "401b7c167d35... |
5e10227f-79d2-4ee5-a9d3-90ddece7ab9f | SaiTp/LeetCode-Codes | Subtraction in Linked List - GFG/subtraction-in-linked-list.cpp | // { Driver Code Starts
// driver
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
/* Linked list Node */
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
struct Node* buildList(int size)
{
int val;
cin>> val;
... | ALGO | 0.99964 | 5.641344 | {
"github_metadata": {
"branch": "main",
"commit_count": 4136,
"repo_created_at": "2021-03-11T06:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd97b6757... |
27b1c973-b9b8-4c7d-9091-aabbc84fe37b | GabrielBejar/CCOMP2-2-2023-1-UCSP | semana_6/Practica_Calificada/Ejer_1_recursivo.cpp | /*
Dos funciones (recursiva e iterativa), cada una de ellas, que reciba como argumento un arreglo de enteros y un entero que representa su tamaño,
y que verifique si los elementos de un arreglo de enteros representan un palindromo; ejm {1, 2, 3, 2, 1} es palindromo, {1, 2, 3, 4, 5} no es.
*/
#include <iostream>
usi... | ALGO | 0.999317 | 5.868353 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-03-15T22:35:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b661eec861e... |
8201adbe-008e-42b0-ba27-6ff3e2de2bde | styro103/AcademicPrograms | CS142 (C++)/Sum2.cpp | #include <iostream.h>
#include <stdio.h>
#include <string.h>
#include "mpi.h" // message passing interface
int main (int argc, char * argv[])
{
int my_rank; // my CPU number for this process
int p; // number of CPUs that we have
int source; // rank of the sender
int dest; // rank of destination
int t... | ALGO | 0.999818 | 4.392444 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2014-05-31T00:42:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ec91f38d... |
b168f066-5c54-4430-abdc-c7766233254b | PavlovVitaly/yandexPracticumBackendCpp | sprint3/problems/instrumentation/solution/binarytree.h | #include <stdlib.h>
#include <stdio.h>
#ifndef BINARYTREE_H
#define BINARYTREE_H
class btr_node
{
public:
~btr_node ();
btr_node (void * n_key, void * n_content, btr_node * n_left = NULL, btr_node * n_right = NULL)
{
key = n_key;
content = n_content;
left = n_left;
right = n_right;
}
void * get (void * k... | ALGO | 0.999471 | 3.947776 | {
"github_metadata": {
"branch": "main",
"commit_count": 307,
"repo_created_at": "2022-10-31T09:28:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3174284a7c... |
91e67667-2e25-428c-a614-a801900fe1d2 | pbysu/BOJ | ~2017/5558.cpp | #include<iostream>
#include<algorithm>
#include<queue>
#include<cstring>
using namespace std;
int n, m, k;
int dr[4] = { 0,0,1,-1 };
int dc[4] = { 1,-1,0,0 };
vector<vector<char>> arr;
vector<pair<int, int>> pos;
bool visited[1001][1001];
int bfs(int k) {
queue< pair<int, int>> q;
q.push({ pos[k].first, pos[k].seco... | ALGO | 0.99993 | 3.422285 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-04-01T08:07:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c67182277... |
b3f40100-1e46-4fc2-9996-0bf8ed3e2ebe | CoderXiaoLiu/Data_Structure_And_Algorithm | data_structure_and_algorithm/二分答案/akoj2802.cpp | #include<bits/stdc++.h>
using namespace std;
using LL = long long;
void solve() {
int t;
scanf("%d", &t);
while(t--) {
int n, m;
scanf("%d%d", &n, &m);
int a[n];
LL l = 0, r = 0;
for(int i = 0; i < n; i++) {
scanf("%d", &a[i]);
r += a[i];
... | ALGO | 0.999982 | 4.013263 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2022-12-28T08:24:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9af94e7494... |
de1d05d1-85af-4161-91d5-ed559db65498 | KIMBIBLE/algorithm_solving | codeplus/2346.cpp | /*
* # 2346 : 풍선 터트리기
* - 문제
* N개의 풍선이 있다. 각 풍선 안에는 -N부터 N까지의 수가
* 적혀있는 종이가 들어 있다. 이 풍선들을 다음과 같은 규칙으로 터뜨린다.
* 우선, 제일 처음에는 1번 풍선을 터뜨린다.
* 다음에는 풍선 안에 있는 종이를 꺼내어 그 종이에 적혀있는 값만큼
* 이동하여 다음 풍선을 터뜨린다. 양수가 적혀 있을 경우에는 오른쪽으로,
* 음수가 적혀 있을 때는 왼쪽으로 이동한다. 풍선은 원형으로
* 놓여 있다고 생각한다. 즉, 1번 풍선의 왼쪽에 N번 풍선이 있고,
* N번 풍선의 오른쪽... | ALGO | 0.999994 | 5.022758 | {
"github_metadata": {
"branch": "master",
"commit_count": 536,
"repo_created_at": "2017-11-10T02:25:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6b97e0a... |
48e322c7-09f9-4950-9026-f86d6b48dcdc | sumanthcherupally/OS2_assignments | OS-2 Assignment1/Assgn1-_EE17BTECH11041_/Assgn1-RMS_EE17BTECH11041_.cpp | #include<stdio.h>
#include<iostream>
#include<string.h>
#include <bits/stdc++.h>
#include<algorithm>
#include<unistd.h>
using namespace std;
typedef struct
{
int Pid,t,p,k;
int start_index;
int status;
}process;
int main()
{
int TIMER=0;
FILE *inp,*log_out,*stat_out;
int n; //Num... | ALGO | 0.989278 | 3.555129 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-31T01:03:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9a21dd0e39d... |
573b395e-f30c-4000-92d1-8e535d932fc1 | jaehyunp/stanfordacm | stanford-cardinal-16/src/math_ntt.cpp | const int maxn=300005;
const int g=3,bigp=479*(1<<21)+1,x=21;
int LA,LB;
int a[maxn],b[maxn],w[maxn];
int C,N,L;
int powc(int a,int b) {
int d;
if (b==0) return 1;
d=powc(a,b/2);
d=(LL)d*d%bigp;
if (b%2==1) d=(LL)d*a%bigp;
return d;
}
inline void FFT(int x[],int K,int v){
//K is the length of x[]
//v=0 ... | ALGO | 0.999851 | 3.310236 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2014-06-19T22:27:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1630,
"forks": 496,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3448... |
900ab4de-5f68-4129-a8d6-33e94582afc0 | PrajwalCC/DSA | 7.DP/3. Longest common subsequence/11_3_longest_increasing_subsequence_space_opti_IMP__.cpp | // resource -- Love babbar
#include <bits/stdc++.h>
using namespace std;
int solve(int a[],int n, int idx, int prev){
// vector<vector<int>> dp(n+1, vector<int>(n+1, 0)); //replce with two 1D vector
// replacement-> dp[i][j+1] = curr[j+1] , dp[i+1][j] = next[j]
// we are just replacing dp[i] --> curr & dp... | ALGO | 0.999711 | 3.755238 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2022-07-11T18:09:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78ebb5ea9... |
f7e780bb-1e5b-4550-a1a7-ad7a789c590a | luizasch2/Aulas_ED | aula18.cpp | #include <iostream>
#include <chrono>
using namespace std;
using namespace std::chrono;
void insertionSort(int arriNumbers[], int iLength)
{
for (int iOuterLoop = 1; iOuterLoop < iLength; iOuterLoop++)
{
int iTemp = arriNumbers[iOuterLoop];
int iInenerLoop = iOuterLoop - 1;
while (iTe... | ALGO | 0.999724 | 5.625202 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2023-03-20T11:52:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5afe86a36... |
296576e8-c674-41ee-8683-c9d1adc56906 | ppap-1264589/TEMPLATES | 4. Data Structures/Heavy Light Decompose.cpp | struct Heavy_Light_Decomposition{
const static int maxn = 1e5 + 10;
vector<int> a[maxn];
static int n,R;
//numnode, root of tree
static int W[maxn];
//weight of node
static int Tsize[maxn], heavy[maxn], par[maxn];
//size of tree, heavy node, parent of node
void DFS(int& u){
... | ALGO | 0.999951 | 5.229415 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-08-23T08:08:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "152f2de0b7b... |
899954ac-64e3-44bf-b88c-3db900bdf37f | black-shadows/InterviewBit-Topicwise-Solutions | Stacks and Queues/Is given level order a BST.cpp | struct node {
int val;
int min;
int max;
node(int val, int min, int max) : val(val), min(min), max(max) {};
};
int Solution::solve(vector<int> &A) {
if(A.empty()) return 1;
queue<node> q;
bool left_available = true;
bool right_available = true;
node cur_node(A.front(), numeric_limit... | ALGO | 0.99988 | 4.939338 | {
"github_metadata": {
"branch": "master",
"commit_count": 141,
"repo_created_at": "2018-06-16T10:05:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 363,
"forks": 217,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "c925... |
3d898efc-720c-4b44-a4b8-c04260845f3c | jsanyam/Codes | Book/DAG_longpath.cpp | #include<iostream>
#include<list>
#include<stack>
#include<climits>
using namespace std;
struct node
{
int index, dis;
};
class Graph
{
int vertices;
list<struct node> *adj;
void topo_sort_util(stack<int>& s, int visited[], int index);
public:
Graph(int v);
void add_edge(int v, int w, int dis... | ALGO | 0.999987 | 4.46595 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-01-18T14:12:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa4d3f441d... |
d77d7a85-4ee6-452a-8827-64c43d441e27 | versatran01/dsol | sv/dsol/select.cpp | #include "sv/dsol/select.h"
#include "sv/dsol/pixel.h"
#include "sv/util/logging.h"
#include "sv/util/tbb.h"
namespace sv::dsol {
int Proj2Mask(const DepthPointGrid& points1,
cv::Mat& mask,
double scale,
int dilate) {
CHECK_GT(scale, 0);
CHECK_LE(scale, 1);
CHECK_GE(di... | ALGO | 0.96768 | 6.629115 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-03-03T15:47:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 395,
"forks": 73,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "c93fbc07... |
99490f09-fdd7-477d-b86d-10882741adc4 | zrudzionis/Kompiuterine-grafika | opengl_pvz/sierpinski_rec_2.cpp | /*
* Serpinski_rec_2.c
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <GL/glut.h> // OpenGL Graphics Utility Library
// Number of step
int CurrentNum = 0;
const int MaxNum = 10;
// These variables set the dimensions of the rectanglar region we wish to view.
const double Xmin = -0.1, Xmax = 1.1;
const doubl... | ALGO | 0.997681 | 4.820909 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2014-09-19T15:58:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79805a3b4... |
af7d8a0b-5739-42b9-bb7b-2f13694c0ee0 | teichmaj/PredatorReinforcementLearningSimulator | energy.cpp | #include "energy.hpp"
#include "config.hpp"
#include "global.hpp"
#include "sgn.hpp"
#include "age.hpp"
#include "reward.hpp"
#include "time.hpp"
#include <blitz/array.h>
#include <cmath>
#include <csignal>
using namespace blitz;
Energy::Energy (const Config *CONFIG_)
{
CONFIG = CONFIG_;
}
Energy::~Energy ()
{
... | ALGO | 0.996798 | 5.616215 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-06-30T17:32:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1101d35e85... |
1d16124b-aede-43ec-80c6-7abe319571aa | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03033/s529452447.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib>
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size()... | ALGO | 0.999879 | 3.566537 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "92204b5b19... |
38262527-5b3e-4051-8386-a565ab0cdbce | FORTH-ModelBasedTracker/MocapNET | src/MocapNET2/MocapNETLib2/core/core.hpp | #pragma once
#include "../../MocapNETLib2/mocapnet2.hpp"
/**
* @brief Given an orientation angle this function can decide on which orientation class it belong to corresponding to the MOCAPNET_Orientation enum
* @param Angle in degrees
* @retval MOCAPNET_Orientation enumeration value
*/
int getMocapNETOrientati... | ALGO | 0.989648 | 5.497519 | {
"github_metadata": {
"branch": "master",
"commit_count": 544,
"repo_created_at": "2019-07-05T11:13:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 899,
"forks": 137,
"issues": 18,
"pull_requests": 1
},
"file_meta": {
"content_id": "6725... |
f1c4354e-6b14-4882-ba02-e3cfd0f947f9 | gopoma/competitive-programming | tasks/1881G.cpp | //* sometimes pragmas don't work, if so, just comment it!
#pragma GCC optimize ("Ofast")
//? #pragma GCC target ("avx,avx2")
//! #pragma GCC optimize ("trapv")
//! #undef _GLIBCXX_DEBUG //? for Stress Testing
#include <bits/stdc++.h>
using namespace std;
//* Debugger
string to_string(string s) {
return '"' + s +... | ALGO | 0.999805 | 5.196837 | {
"github_metadata": {
"branch": "main",
"commit_count": 821,
"repo_created_at": "2023-08-11T20:58:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2712bf0f5... |
189b1618-a0af-42ee-b9fe-e3ec70ae15c4 | HassnHamada/CP-Solutions | cses2220.cpp | #include <bits/stdc++.h>
// #include <chrono>
using namespace std;
// using namespace std::chrono;
typedef long long int ll;
ll dp[20][10][2][2];
ll work(int n, int m, int s, int c, const string &str)
{
if (!n)
{
return 1;
}
if (~dp[n][m][s][c])
{
return dp[n][m][s][c];
}
l... | ALGO | 0.999914 | 3.987485 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2022-02-11T19:29:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "649bed1db... |
c5de8ffd-440a-4f5f-9ec5-c44c98c89061 | MenCodermin/CPP-Solutions | validsudoku.cpp | #include <iostream>
#include <unordered_map>
#include <map>
#include <set>
#include <utility>
#include <vector>
using namespace std;
class Solution
{
public:
bool isValidSudoku(vector<vector<char>>& board)
{
unordered_map<char,set<char>> row;
unordered_map<char,set<char>> column;
m... | ALGO | 0.99924 | 6.809736 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-11-26T22:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fe8869172... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.