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 |
|---|---|---|---|---|---|---|---|
4403d664-0bab-41ad-8aab-5fe1f0a947b1 | sunkyuj/ps | SWEA/D4/8898. 3차원 농부/3차원 농부.cpp | #include <iostream>
#include <algorithm>
#define MAX 500001
using namespace std;
int cows[MAX], horses[MAX]; // 10**8 = 1억
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int T;
cin >> T;
for (int tc = 1; tc <= T; tc++)
{
int n, m, c1, c2;
cin >> n >> m ... | ALGO | 0.99997 | 3.248802 | {
"github_metadata": {
"branch": "master",
"commit_count": 298,
"repo_created_at": "2023-01-10T15:53: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": "68166d4f... |
758ba6a2-88b7-419b-b789-a4f073f7920f | TaoSama/ICPC-Code-Library | ACM - Topics Training/xor & trie/BZOJ 4260.cpp | //
// Created by TaoSama on 2016-04-21
// Copyright (c) 2016 TaoSama. All rights reserved.
//
#pragma comment(linker, "/STACK:102400000,102400000")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#inc... | ALGO | 0.99999 | 3.974119 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2016-03-24T05:56: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": "5ba1ddcd... |
f9492f6f-33e0-4966-8b91-f1812a2fa2a9 | Clouder0/AlgorithmPractice | Codeforces/contest/1436/D.cpp | #include <cstdio>
#include <algorithm>
#include <ctype.h>
const int bufSize = 1e6;
#define int long long
inline char nc()
{
#ifdef DEBUG
return getchar();
#endif
static char buf[bufSize], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, bufSize, stdin), p1 == p2) ? EOF : *p1... | ALGO | 0.999963 | 3.502508 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-10-23T12:45: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": "0bae5fc26e0... |
263fef5e-2274-4b72-b450-0b7f8be83af9 | thhyj/bzoj-ACcode | bzoj3631.cpp |
#include <bits/stdc++.h>
using namespace std;
inline void R (int &v) {
static char ch;
v = 0;
bool p = 0;
do {
ch = getchar();
if (ch == '-') p = 1;
} while (!isdigit(ch));
while (isdigit(ch)) {
v = (v + (v << 2) << 1) + (ch^'0');
ch = getchar();
}
if (p) v = -v;
}
vector<int> q[300005];
int a[300005],... | ALGO | 0.999907 | 3.697291 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-17T03:08: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": "7644bd8f9f... |
0ad6d287-8d79-4101-8509-89ee2bbb75cc | liuruoze/EasyPR | include/easypr/util/program_options.h | /***********************
* This file is a packed library of
* ProgramOptions(http://github.com/Micooz/ProgramOptions).
* ProgramOptions is a library for generating and parsing command line.
***********************/
#ifndef UTIL_PROGRAM_OPTIONS_H
#define UTIL_PROGRAM_OPTIONS_H
#include <algorithm>
#include <casser... | TOOL | 0.945688 | 6.581035 | {
"github_metadata": {
"branch": "master",
"commit_count": 582,
"repo_created_at": "2014-09-19T11:46:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6407,
"forks": 2498,
"issues": 77,
"pull_requests": 9
},
"file_meta": {
"content_id": "8... |
802dad66-8842-440f-b522-847c41400e6d | safrannn/optimization | particle_swarm/src/main.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include "run.h"
#include "func.h"
#include "data_stats.h"
using namespace std;
int main() {
setSeed();
int experiment = 50;
vector<DataStats> result_best;
result_best.push_back(runFunc(experiment, "schwefel", func::schwefel, -512, 512)); //
... | ALGO | 0.978598 | 4.847268 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-01-30T03:02:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e1e7b0ec... |
def27d12-63ae-49c5-b378-3d234cf7a3a0 | Justinarghyyy/NYU-Tandon-Bridge-2023 | Week16/q2.cpp | #include <iostream>
#include <vector>
template <class T>
class Queue{
public:
Queue() : start(0), end(0), size(0) {}
void enqueue ( T newItem ) {
data.push_back( newItem );
end ++ ;
size ++ ;
}
T dequeue() {
if ( size == 0 ) {
cout << "Queue is empty" << ... | TOOL | 0.956651 | 3.908297 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2023-02-01T19:12:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2747425e9fc... |
a830bfd9-d255-49dc-a8af-081d0c7afb00 | LeadCoding/3-weeks-Google-Prep | 01. Graphs/04. CycleDetection/3. IsBipartite.cpp | // Notes
/*
Notes
1-We can easily solve the problem of IsBipartite graph by DFS/BFS alternate colouring
2-Property to be Bipartite ( either no cyle ie Tree. OR even len cycles )
3-Odd len cycles simply means not bipartite
4-We can use this colouring technique to find if there is odd len cycle ( ju... | ALGO | 0.998229 | 5.479301 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-06-18T11:18:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1624,
"forks": 777,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "b0073d... |
4c84df6d-fafb-4a52-96c0-5613abee8a26 | Youngwook-Jeon/algorithm-problems-solving | leetcode/1140_StoneGame2.cpp | #include <vector>
#include <climits>
#include <algorithm>
#include <functional>
using namespace std;
class Solution
{
public:
int stoneGameII(vector<int> &piles)
{
int n = piles.size();
vector<vector<vector<int>>> table(2, vector<vector<int>>(n + 1, vector<int>(n + 1, -1)));
function<i... | ALGO | 0.999957 | 4.504647 | {
"github_metadata": {
"branch": "main",
"commit_count": 252,
"repo_created_at": "2021-04-22T10:01:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a97b62b2ec... |
fd5468eb-031e-4ae8-bc18-58d5b78a539e | soomrack/MR2024 | LapkinYD/b_tree/BTree.cpp | #include "BTree.h"
#include <iostream>
Node* Tree::createNode(Node* parent) {
Node* newNode = new Node;
newNode->keysCount = 0;
newNode->parent = parent;
for (int i = 0; i < 2 * T; i++) {
newNode->children[i] = nullptr;
}
for (int i = 0; i < 2 * T - 1; i++) {
newNode->... | ALGO | 0.999975 | 4.100274 | {
"github_metadata": {
"branch": "main",
"commit_count": 1957,
"repo_created_at": "2024-09-03T15:29:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "6524966a7... |
811e648a-45c1-4107-be7f-10a131ed1015 | aditcrey/Competitive-Boilerplates | FirstElementInStreamofChars.cpp | //======================================================WITH LIST AND ARRAY OF LIST POINTERS======================================
void firstElementStream(vector<char> &stream){
int n = stream.size();
list<char> lst;
vector<bool> repeated(256,false);
vector<list<char>::iterator> DLL(256,lst.end());
... | ALGO | 0.999868 | 3.855647 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-08-07T04:55:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94e41a2f1... |
d7c8d733-de42-403c-a6c2-be9ada5778a5 | Matistjati/Competitive-programming-solutions | po/pokval18/lisp2c.cpp | #include <iostream>
#include <vector>
#include <map>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <set>
#include <unordered_set>
#include <string>
#include <iterator>
#include <queue>
#include <tuple>
#include <numeric>
#include <random>
#include <time.h>
#include <stack>
#include <chrono>
#include... | ALGO | 0.996677 | 3.94312 | {
"github_metadata": {
"branch": "master",
"commit_count": 870,
"repo_created_at": "2021-09-14T12:27: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": "770eda93... |
dbcaba6d-6351-48a5-a407-92f32989afae | viraj071/LeetCode | SearchforaRange.cpp | /*
Problem: Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not found in the array, return [-1, -1].
For example,
Given [5, 7, 7, 8, 8, 10] and target value 8,
r... | ALGO | 0.999988 | 6.403404 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2014-08-12T10:39:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3f38370a... |
135061f3-3a9f-4ae9-9055-155a2635b2c7 | ikr/algo-practice | topcoder/2024/srm853/C/solution.cpp | #include "lest.hpp"
#include <bits/stdc++.h>
using namespace std;
template <typename T> ostream &operator<<(ostream &os, const vector<T> &xs) {
os << '[';
for (auto i = xs.cbegin(); i != xs.cend(); ++i) {
if (i != xs.cbegin()) os << ' ';
os << *i;
}
os << ']';
return os;
}
using ll... | ALGO | 0.999904 | 5.635027 | {
"github_metadata": {
"branch": "master",
"commit_count": 5422,
"repo_created_at": "2016-06-23T07:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "222784f... |
50bf5665-f42d-49ba-996b-a4bef448728a | StackedCrooked/stacked-crooked | Playground/memcpy_vs_cast/main.cpp | #include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <vector>
#include <chrono>
#include <cxxabi.h> // for demangler
class Stopwatch
{
public:
typedef std::chrono::h... | TEST | 0.971625 | 5.39923 | {
"github_metadata": {
"branch": "master",
"commit_count": 3271,
"repo_created_at": "2015-03-19T03:25:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bed4f2... |
d1091592-08cb-485a-af44-e311a12f2a3c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/07/0724/personal_submission/cf367c_Equinox.cpp | #include <bits/stdc++.h>
#define sc scanf
using i64 = long long;
using i128 = __int128;
using PII = std::pair<int, int>;
constexpr int inf32 = 1e9 + 7;
constexpr i64 inf64 = 1e18 + 7;
constexpr int P = 998244353;
constexpr double eps = 1e-6;
// #define DEBUG
void solve()
{
int n, m;
std::cin >> n >> m;
st... | ALGO | 0.999957 | 3.797895 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "fcbe... |
9a927ac2-4786-4ff9-978b-3ba9770d5ab9 | palilo815/ps | baekjoon/23000/23295.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmin(T& _old, T _new) { return _old > _new && (_old = _new, true); }
template <class T>
bool chmax(T& _old, T _new) { return _old < _new && (_old = _new, true); }
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
#ifdef palilo
freopen... | ALGO | 0.999994 | 4.398615 | {
"github_metadata": {
"branch": "master",
"commit_count": 6725,
"repo_created_at": "2020-01-12T04:58:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6ec0de... |
d91a6e6b-19bd-460d-ab76-a75df015f978 | ishandutta2007/codeforces-a | aidos/normal/946/G.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int ... | ALGO | 0.999731 | 3.38175 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "abc91033290a... |
18b128f9-fd7b-4848-84f3-58371993a477 | PhilipCanning/Assignment_1a | question1/question1/question1.cpp | // question1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <conio.h>
#include <Windows.h>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int number1 = 0, number2 = 0, number3 = 0, differOne = 0, differT... | ALGO | 0.996408 | 3.553639 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-11-13T20:52:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd1f5454ca... |
199c3177-3be6-47f7-ab14-668d48d66c1f | eecrazy/ACM | 模板/数据结构/标准RMQ-ST .cpp | //标准RMQ-ST
/**** **** **** **** **** ****
* Function Name : 标准RMQ-ST
* Description : PKU 3264 Balanced Lineup
**** **** **** **** **** ****/
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
const int MAX = 51000;
const int LOGMAX = 16;
int n,q;
int st_max[LOGMAX][MA... | ALGO | 0.999966 | 3.84353 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2013-05-03T06:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 385,
"forks": 113,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3199... |
029d4b59-fe58-460a-98e0-a7c3b8b21c35 | corganhejijun/printer | ReadFile/stpReader/src/BRepFill/BRepFill_ACRLaw.cxx | // Created on: 1998-09-01
// Created by: <NAME>
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser ... | ALGO | 0.953181 | 4.822571 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2019-09-21T08:20:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49392d2b... |
85c87e9d-ddbb-4844-8cc1-4f61a4b11c5c | mMfunnyTree/ACM-ICPC-Template | 数据结构专题/数据结构-cdq分治和整体二分/整体二分——动态区间第k小.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define N 100010
struct rec{
int x,y,k,cnt,id;
rec(){}
rec(int x,int y,int k,int cnt,int id):
x(x),y(y),k(k),cnt(cnt),id(id){}
}q[N*3],q1[N*3],q2[N*3];
const int inf=1e9;
int a[N],ans[N*3],c[N];
int n,m,nn;
inline void ad... | ALGO | 0.99997 | 3.52247 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-10-29T15:19:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc94217f85... |
4d6347ec-2efd-4105-aed2-491eed1c69d1 | ydb-platform/nbs | contrib/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_lazy.h | #pragma once
#include "defs.h"
#include "hulldb_compstrat_defs.h"
// FIXME:
// 1. Check how we calculate compaction rank (FreshRank/LevelRank)
// 2. We now have much more levels, check monitoring
namespace NKikimr {
namespace NHullComp {
//////////////////////////////////////////////////////////////////... | ALGO | 0.960826 | 6.507036 | {
"github_metadata": {
"branch": "main",
"commit_count": 7657,
"repo_created_at": "2023-03-14T17:49:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 75,
"forks": 34,
"issues": 214,
"pull_requests": 78
},
"file_meta": {
"content_id": "5cca9... |
2ca08945-6b7a-4858-9da7-15cc68854360 | BBuf/tvm_mlir_learn | optimize_gemm/how_to_optimize_gemm/test_matrix_multiply.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include "MMult0.h"
// #include "MMult1.h"
// #include "MMult2.h"
// #include "MMult_1x4_3.h"
// #include "MMult_1x4_4.h"
// #include "MMult_1x4_5.h"
// #include "MMult_1x4_6.h"
// #include "MMult_1x4_7.h"
// #include "MMult_1x4_8.h"
// #inc... | ALGO | 0.990893 | 4.271546 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2021-03-16T08:27:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2451,
"forks": 352,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9d41... |
e3faed10-a203-46c2-a147-f25e3deb6238 | TracyLin98/OOPITSA | 1.矩陣數字顯示.cpp | #include <string>
#include <iostream>
#include <map>
#include <queue>
#include <utility>
#include <climits>
#include <functional>
#include <iomanip>
#include <stack>
#include <cmath>
#include <cfloat>
#include <cstdlib>
using namespace std;
class num {
public:
int id;
string pat1;
string pat2;
string pat3;
string... | ALGO | 0.999765 | 3.214608 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-06-28T04:24:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a78ef342042... |
355d1da3-c548-4f2a-beb0-013585780bd2 | h28a3/blackjack | src/main.cpp | #include"header.h"
int deck[13];
int main(void) {
int coin = initialization();
int flag = 0;
int count = 0;
int sum_player = 0;
while (coin > 0) {
vector<vector<int>> card(2); //手札記録用変数
count++;
cout << "\n"<< count << "回目の勝負を開始します.\n";
int bet;
bet =... | ALGO | 0.94233 | 3.488991 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-07-30T03:30:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "272b48b6493... |
01ad693a-9a60-4d1d-99a7-9ee432266500 | s10singh97/Compiler | Lab6/1.cpp | // Operator Precedence Parser
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout<<"Enter the number of Productions: ";
cin>>n;
cout<<"Enter Productions: \n";
string s[n];
for(int i = 0; i < n; i++)
cin>>s[i];
set<char> nt;
for(int i = 0; i < n; i++)
{
... | ALGO | 0.999851 | 4.110088 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-07-22T07:34: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": "670129570497... |
620f6b7f-6c78-4805-82a7-27ff414421d1 | Fmancino/ODEsolver | ODEsolver/src/BackwardEulerSolver.cpp | /*
* BackwardEulersolver.cpp
*
* Created on: Dic, 2015
*
* Author: <NAME>
*
*Description: Class that implements Backward Eulers method to solve a ODE of the form: dy/dt = f(y, t).
* It is derived from the abstract class AbstractOdeSolver.
* To Solve the equation arising due to the fact that Backward Eulers... | ALGO | 0.999501 | 5.132784 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2017-07-28T17:15: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": "14310c177... |
8c9d103f-1f77-4939-95b6-cf1a4a9d73e3 | NRizzza/algorithms-and-data-structures | lab6/bb.cpp | #include <bits/stdc++.h>
using namespace std;
void print(int a[], int n){
for(int i = 0; i < n; i++){
cout << a[i] << " ";
}
cout << endl;
}
int partition(int a[], int low, int high){
int pivot = a[high];
int i = (low - 1);
for(int j = low; j <= high - 1; j++){
if(a[j] < pivot... | ALGO | 0.999982 | 3.718985 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-12-11T20:45:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34e34cd7bf5... |
d807e1e8-e5ca-4ecd-a4ce-d7f68ddf368a | bytedance/lightseq | lightseq/csrc/kernels/cuda/includes/gptKernels.h | #pragma once
#include <cuda.h>
#include <cuda_fp16.h>
#include <curand_kernel.h>
#include "kernels.h"
#include <stdexcept>
namespace lightseq {
namespace cuda {
/**
@brief: launch_gpt_embedding
for gpt embedding, look up token embedding, add position embedding
@param
token_emb: [vocab_size, hidden_size]
pos_emb: [ma... | ALGO | 0.949285 | 5.868658 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2019-12-06T08:25:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3284,
"forks": 331,
"issues": 177,
"pull_requests": 3
},
"file_meta": {
"content_id": "7a... |
716a938c-20fc-42e1-a1a0-fc9d713f30f5 | GRTLCollaboration/Chombo | releasedExamples/MultiDimPhase/util/Divergence.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#include "Divergence.H"
#include "DivergenceF_F.H"
#include "CellToEdge.H"
#i... | ALGO | 0.998286 | 4.973805 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2018-01-30T14:07:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b2a74dacb... |
a3401183-a1c0-4e8b-83b7-e91d5dfd1b0d | Kanhakhatri065/competitive_programming | hackerearth/LittleShinoAndPairs.cpp | /*** I came, I saw, I conquered. ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;typedef unsigned long long ull;
#define sc(a) cin >> a
#define pf(a) cout << a << endl
#define forIn(arr, num) for(ll i = 0; i < num; i++) cin >> arr[i];
#define vpnt(ans) for(ll i = 0; i < ans.size(); i++) cout << ... | ALGO | 0.999973 | 4.280318 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-05-12T22:56:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c352ff78f... |
c7ff6923-b891-4438-b19d-0e4a581d1dc0 | Sapprise/Euler | HaizeiOJ/492.cpp | /*************************************************************************
> File Name: 492.cpp
> Author:
> Mail:
> Created Time: 2019年10月22日 星期二 20时48分12秒
************************************************************************/
#include<iostream>
using namespace std;
int flage[30];
int main() {
int n, a... | ALGO | 0.99999 | 3.812908 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-04-13T12:03:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b77cb6a9... |
1b9b6dcb-ecbd-4658-8b85-184e21d24783 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0812/personal_submission/cf1090d_tiger2005.cpp | int main() {
int n, m; cin >> n >> m;
if (m == 1ll * n * (n - 1) / 2)
return puts("NO"), 0;
puts("YES");
set<pair<int, int>> st;
for (auto [a, b]: getv<int, int>(m))
st.insert(minmax(a, b));
for (int i = 1; i <= n; i ++)
for (int j = 1; j < i; j ++) if (!st.count({j, i})) {
vector<int> v(n... | ALGO | 0.999952 | 3.419279 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "2028... |
9f532d8e-ceaf-4c36-a4df-b95f04b28b38 | Jaganmati/codesamples | NumberTheoryAndCryptography/BigInt.h | // MIT License
// Copyright (c) 2020 <NAME>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, p... | ALGO | 0.997348 | 4.924922 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-02-12T05:58:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ca02931474... |
39939cff-89c8-430f-b8f7-747d0e888850 | ishandutta2007/codeforces-j | juanzhang/normal/1292/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T>
inline void chkmax(T &x, T y)... | ALGO | 0.999639 | 4.114752 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdce2db65e67... |
b14a0bb8-e668-451f-8175-12278790bd71 | hugo451/roteiro1 | 4.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int n, soma = 0, maxv, i;
int array[23];
float porcentagem;
for(int j : array)
{
j = 0;
}
while (n != 0)
{
cout << "Quem foi o melhor da partida? [voto = 1 - 23] (0 = fim)" << endl;
cin ... | ALGO | 0.996691 | 3.87398 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-07T14:48: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": "b29af7424d... |
7e62f200-efce-4cfb-904c-cab0d087c5bb | LukasWang2021/SSR | Motion_controller/src/trajectory_planner/include/vpath_planner.h | #ifndef _VPATH_PLANNER_H_
#define _VPATH_PLANNER_H_
#include <vector>
#include "basic_alg.h"
#include "quaternion.h"
#include "matrix33.h"
#include "vector3.h"
#include "algorithm"
#include "pose_euler.h"
#include "traj_params.h"
class VpathPlanner
{
public:
VpathPlanner();
~VpathPlanner();
/*
Generate... | ALGO | 0.997698 | 5.236472 | {
"github_metadata": {
"branch": "main",
"commit_count": 2237,
"repo_created_at": "2021-10-29T03:21: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": "24501a703... |
09dbe9cc-ba68-4954-b89d-4d676ec9c681 | mactavish2191/CPPWorkspace | DataStructure/Tree/BinaryTree/BST.cpp | #include <iostream>
#include <cstdio>
#include "BST.h"
using namespace std;
BST::BST()
{
root = nullptr;
}
BST::node* BST::createLeaf(int key)
{
node* n = new node;
n->key = key;
n->left = nullptr;
n->right = nullptr;
return n;
}
void BST::addLeaf(int key)
{
addLeafPrivate(key, root... | ALGO | 0.999555 | 4.072366 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-02-20T21:36:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04cbe29777c... |
df7b1c3b-6006-41e7-9db4-4931b864723d | rudenko-gold/cpp-coursera-specialization | Course #4 (Brown Belt)/Week 5/09. Personal Budget (home desktop version)/main.cpp | #include <iostream>
#include <ctime>
#include <sstream>
#include <map>
#include "test_runner.h"
using namespace std;
class Date {
public:
Date(time_t year, time_t month, time_t day) : year(year), month(month), day(day) {
if (yearIsLeap()) {
daysInMonth = { 31, 29, 31, 30, 31, 30, 31, 31, 30, ... | ALGO | 0.99662 | 5.074352 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2019-07-07T16:35:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d7abce3... |
91bff093-fa45-4f41-ab2b-f5cd80428bda | mongodb/mongo | src/third_party/immer/dist/immer/algorithm.hpp | //
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 <NAME>
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include <algorithm>
#include <cassert>
#include <funct... | TOOL | 0.996616 | 6.509528 | {
"github_metadata": {
"branch": "master",
"commit_count": 90314,
"repo_created_at": "2009-01-15T16:15:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 27329,
"forks": 5655,
"issues": 0,
"pull_requests": 82
},
"file_meta": {
"content_id": ... |
7e73354f-0bba-42ff-8ddf-1ff2e064c29e | ishandutta2007/codeforces-a | avinashkartik/normal/1088/B.cpp | #pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
using namespace std;
#define fastio ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision... | ALGO | 0.999955 | 3.555691 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "fb13d480d584... |
00db61d6-dd7d-4f41-9234-5e3ae0930e4c | Anmol977/Data-Structures-and-Algorithms | Data Structures/Binary Tree/btree.cpp | #include <iostream>
#include <algorithm>
#include <queue>
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
data = d;
left = nullptr;
right = nullptr;
}
};
node *create_tree()
{
int d;
std::cin >> d;
if (d == -1)
... | ALGO | 0.999972 | 4.350986 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2021-05-22T11:52: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": "051d7ff5bc... |
adc8b41e-dcec-407c-9fa3-c2ee0ecec098 | ShahjalalShohag/ProblemSolving | codeforces/1394/A.cpp | #include<bits/stdc++.h>
using namespace std;
vector<long long> a[2], p[2];
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, d, m; cin >> n >> d >> m;
for (int i = 1; i <= n; i++) {
int k; cin >> k;
if (k > m) a[1].push_back(k);
else a[0].push_back(k);
}
for (int i = 0; i < 2; i++) {
sort... | ALGO | 0.9999 | 3.076672 | {
"github_metadata": {
"branch": "master",
"commit_count": 2261,
"repo_created_at": "2020-12-20T21:28:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cf5d... |
f8a3113d-bf76-40fa-bcab-f34c03ad2b87 | Vector-013/CP-Vector013 | Codeforces/DIV2_B/Prinzessin_der_Verurteilung.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <math.h>
#include <stdlib.h>
#include <string>
#include <numeric>
#define pb push_back
#define pop pop_back
using namespace std;
typedef long long ll;
typedef long double ld;
const int inf = 2e9;
const ll linf = 9e18;
bo... | ALGO | 0.999986 | 3.947652 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2023-10-02T08: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": "f258eaf5a... |
6d27b582-d533-45d9-a1a9-d37bc1b4d1f6 | heweitykc/cpp11_study | proj/动画资源/cocos/roadsearch.cpp | #include "roadsearch.h"
#include <algorithm>
#include <iostream>
void RoadSearch::init()
{
for(int i=0;i<WIDTH;i++)
for(int j=0;j<HEIGHT;j++){
_roads[i][j].x = i;
_roads[i][j].y = j;
_roads[i][j].pid = 0;
_roads[i][j].costMultiplier = 1.0f;
}
}
void RoadSearch::update(int x, int y, int pid)
{
_roads... | ALGO | 0.999616 | 3.931002 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2014-05-06T13:43:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57fb1b025... |
dac5879b-e03e-4d3a-b42b-f8ecebfc8f52 | anirin/webserv | src/config/LocConf.cpp | #include "LocConf.hpp"
// Constructor
LocConf::LocConf() : _path("") {}
LocConf::LocConf(std::string content, std::string path, LocationType type) : _type(type), _path(path) {
// init
_locations.clear();
_limit_except.clear();
_autoindex = false;
_index.clear();
_root.clear();
_client_max_body_size = 1024 * 10... | TOOL | 0.901264 | 4.672918 | {
"github_metadata": {
"branch": "main",
"commit_count": 197,
"repo_created_at": "2024-07-05T04:35:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "526a95d93e... |
e2f44674-6175-43c4-83b0-dca18475fc43 | LChanwoo/backjoon_practice | cpp/p1991.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
using namespace std;
int visited[27];
int n;
vector<int> node[27];
void preOrder(int here)
{
if(visited[here] || here==26)return;
visited[here] = 1;
cout << (char)(here + 'A');
for(int there : node[here]){
preOrder(there)... | ALGO | 0.999982 | 3.705109 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2023-10-19T10:48:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf4a8ea03d... |
e6c47278-53e1-410b-98de-25f47852e76a | carminecoppola/Algorithms-and-Data-Structures-Implementations | 01. ProvaImpronta/MergeSortAstratto_Posto/algoritmo.h | #ifndef ALGORITMO_H
#define ALGORITMO_H
/*Merge astratto sul posto quindi abbiamo due sottoarray dove uno e ordinato
in modo crescente e l'altro in modo decrescente;*/
#include<iostream>
#include<vector>
using namespace std;
template<class T>
class algoritmo
{
private:
static void merge(vector<int>::iterator s... | ALGO | 0.999701 | 5.494174 | {
"github_metadata": {
"branch": "main",
"commit_count": 385,
"repo_created_at": "2022-10-01T20:41:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f7ea318c2... |
0d4bc922-4864-4b7e-9a2b-d7ebab8bb7c7 | githole/akari10 | main.cpp | #include <cstdio>
#include <cstdlib>
#include <omp.h>
#include <random>
#include <algorithm>
#include "utility.h"
#include "renderer.h"
#include "simd.h"
#include "perlin.h"
#include "pbd.h"
using Float3 = utility::Float3;
using Random = utility::random::PCG_64_32;
struct BaseParameter
{
int width{ 1280 };
... | ALGO | 0.986234 | 3.816153 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-13T14:52:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3922acbbd3bf... |
bfdbb08a-7e00-4a8e-b7e8-c59af66169cf | Luis-Pedroza/Cpp | POO/Programa.cpp | #include"funciones.h"
using namespace std;
int P[5],n;
int PA[5],nA;
float Evaluar(float v)
{ float vf=0;
int f=0;
do
{ vf+=P[f]*pow(v,n-f);
f++;
}while(f!=n+1);
return vf;
}
float EvaluarA(float vA)
{ float vfA=0;
int fA=0;
do
{ vfA+=PA[fA]*pow(vA,nA-fA);
fA++;
}while(fA!=nA+1);
return vfA;
}
float Evalu... | ALGO | 0.999737 | 4.343847 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-04-09T21:10:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77cb19cabe0... |
eed9cd00-0e83-4ec1-bc3b-68bdeb57b649 | hossam7amdy/computer-science-major | 07-algorithms-II/09-Backtracking/00-practice/partition-to-k-equal-sum-subsets-v2.cpp | // https://leetcode.com/problems/partition-to-k-equal-sum-subsets/
// WARNING: this solution gives `TLE`
#include<bits/stdc++.h>
using namespace std;
const int MAX = 16 + 1;
bool visited[MAX];
int k;
int partitionSum;
vector<int> numList;
vector<vector<int>> partitions;
bool tryPartition(int partition_idx, int cur... | ALGO | 0.999613 | 5.416671 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-07-24T20:21:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e5ced3380a... |
3a9ed81b-609c-40f7-89a1-012e2e46b910 | vedantpatil25/Leetcode-Questions-Solutions | Prime List - GFG/prime-list.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node *next;
Node(int num){
val=num;
next=NULL;
}
};
// } Driver Code Ends
//User function Template for C++
/*
class Node{
public:
int val;
Node *next... | ALGO | 0.999915 | 5.066091 | {
"github_metadata": {
"branch": "main",
"commit_count": 474,
"repo_created_at": "2023-01-21T14:13:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4545d5900... |
bdc7ac93-03eb-4a91-9613-598ce31f780d | georgmartius/lpzrobots | selforg/controller/som.cpp | /***************************************************************************
* Copyright (C) 2005-2011 LpzRobots development team *
* <NAME> <georg dot martius at web dot de> *
* <NAME> <guettler at informatik dot uni-leipzig dot de *
* <NAME> <frank at n... | TOOL | 0.978341 | 4.969711 | {
"github_metadata": {
"branch": "master",
"commit_count": 3359,
"repo_created_at": "2011-11-23T13:44:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 26,
"issues": 2,
"pull_requests": 3
},
"file_meta": {
"content_id": "a1674... |
0c8b1dc4-1aa4-44ce-be36-d09689858cd2 | cyborg7459/Data_Structures_and_Algorithms | Data Structures/09 - Graph/17-Course_scheduling.cpp | // PS : Given number of courses 'n' and a prerequisites list, which contains pairs of courses, where each pair {a, b} denotes that course b is a pre prerequisite for course a. We need to find out
// the order in which we can do the courses, or return an empty array if not possible
// Explanation : The order would be t... | ALGO | 0.999955 | 5.342094 | {
"github_metadata": {
"branch": "master",
"commit_count": 461,
"repo_created_at": "2020-09-15T14:51: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": "e51109b8... |
cf08562d-5f2f-4a83-8519-b94a5c1a1d79 | Utkarsh-code/DSA-Playlist | CP/24.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
#define pi pair<int, int>
int mod=1e9+7;
int inf=1e18;
int ninf=-1e18;
int pown(int x, int y){
int res=1;
while(y){
if(y&1) res=(x*res)%mod;
x=(x*x)%mod;
y>>=1... | ALGO | 0.999908 | 4.318889 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-04-11T06:31:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1df60ed816d... |
1f162acc-d461-4278-a990-2dc6c6d5f82c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0524/personal_submission/cf1095d_Amani.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int p[MAXN], a[MAXN][2], vis[MAXN];
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i][0] >> a[i][1];
}
int i = 1;
cout << 1;
vis[1] = 1;
int cnt = n-1;
while (cnt--) {
int ... | ALGO | 0.999963 | 3.795582 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "a72b... |
a36c4bb6-9bb6-461b-8824-d382e05317da | franzzi70/ProjectEuler | P0123_PrimeSquareRemainders/P0123_PrimeSquareRemainders/main.cpp | // main.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <chrono>
#include "primes.h"
const __int64 REMAINDER_THRESHOLD = 10'000'000'000;
const int MAXPRIME = 1000000;
primes::PrimesSieve g_primes(MAXPRIME);
__int64 nPowMod(__int64 n, __int64 p, ... | ALGO | 0.99944 | 5.271775 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2023-08-06T08:33:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59c37578e9... |
a0ffb5d2-482c-48bb-a45d-56dca61432d9 | yjl9903/XCPC | Codeforces/global11/d.cpp | #include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#ifdef XLor
#define dbg(args...) cout << "\033[32;1m" << #args << " -> ", err(args)
void err() { std::cout << "\033[39;0m" <<... | ALGO | 0.999873 | 3.350214 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d22c7af2a740... |
bc22d7d3-6f7e-476e-ad76-05f44b425a2c | byLeilany/tp-Algoritmos3 | tp1/tp1EnLaptopDani/tthiago rompiendo todo.cpp | #include <iostream>
#include <math.h>
#include <vector>
using namespace std;
// vector<int> v = {4,4,7};
vector<int> v = {7,10,10,50};
//pruebas sin resta
// vector<int> v = {3,1,5,2,1}; //lo recibe x cin
// int w = pow(pow(3,5), 2) + 6;
// int w = 33;
// int w = 17;
// int w = 9;
int w = 10;
int M = 5;
vector<vec... | ALGO | 0.999927 | 3.477259 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-05-17T13:47:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0703a9ca0bc... |
46dae317-ff7a-4a5a-8718-3d17e0684239 | Gosmann/programming_c_plus_plus | chapter_4/exercises/11.cpp | #include "std_lib_facilities.h"
#define MAX_CHECK 1e5
int check_prime(int num){
int i;
int result = 1;
// encoding
// 1 -> is prime
// 0 -> is not prime
if( num > 1 ){
for( i = 2 ; i < num ; i++ ){
if( ( num % i ) == 0 ){
result = 0;
b... | ALGO | 0.995257 | 4.57811 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-08-15T05:54:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca099de6406... |
e363f882-89e7-4ef8-8da0-bd1090d42aa4 | Yotta2/Leetcode | Flatten Binary Tree to Linked List.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <set>
#include <stack>
#include <vector>
#include <list>
#include <cstdlib>
#include <climits>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <time.h>
#include <functiona... | ALGO | 0.999864 | 4.345315 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2013-09-18T19:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c509fa2b5... |
fe87ef47-252e-44ca-a144-a0f6de36e54d | tribe01/Rosenthal | rosenthal.cc | #include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
struct input {
double x_length, y_length, z_length;
int x_count, y_count, z_count;
double eff, V, I, vel, k, a, To;
} rosen_input;
struct domain {
double x, y, z, T;
};
void get_input(input &user_input);
void initialize_dom... | ALGO | 0.987029 | 4.227875 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-03-30T23:56:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eaad3b83d0... |
f6518cf1-5768-4479-9b62-5e80a51e446a | atlas25git/VictoryMarch | Day34/RoogTop.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find maximum number of consecutive steps
//to gain an increase in altitude with each step.
int maxStep(int a[], int n)
{
int c=0;
int m=0;
... | ALGO | 0.999802 | 5.242767 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2021-05-10T14:25:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfaa59a454... |
f0ff27a8-6555-4fff-9997-b07925c67834 | JasVixBan/kamasu | komrade/komrade/detail/inner_product.inl | /*
* Copyright 2008-2009 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | ALGO | 0.997178 | 7.31927 | {
"github_metadata": {
"branch": "master",
"commit_count": 203,
"repo_created_at": "2016-08-02T06:29: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": "d03f1226... |
f0f03103-7e66-4603-8c68-8e4d7f70879f | faddock/cp-notebook | dp-mattoxbasketball.cpp | // #include <bits/stdc++.h>
// using namespace std;
// int main() {
// ios::sync_with_stdio(false);
// cin.tie(NULL);
// int n; cin >> n;
// vector<int> a(n);
// for (int i = 0; i < n; ++i) {
// cin >> a[i];
// }
// vector<int> b(n);
// for (int i = 0; i < n; ++i) {
// ... | ALGO | 0.999953 | 4.624095 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-03-26T21:37: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": "ce2e47c5676... |
0b54998d-aad4-43b9-8c73-21feb855d502 | ishandutta2007/codeforces-a | akim/normal/615/D.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <ctime>
#include <stack>
#include <map>
#include <set>
using namesp... | ALGO | 0.999942 | 3.991904 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "761c3d0417d3... |
d8b415f9-7b2e-44b6-9b5c-0dbd84b0c09b | iyungui/TIL-codetree | 241206/진수 to 진수/transformation-of-number-system.cpp | #include <iostream>
#include <string>
using namespace std;
int ToDecimal(int n, int a) {
int num = 0;
string str_digits = to_string(n);
for(int i = 0; i < str_digits.length(); i++) {
num = num * a + (str_digits[i] - '0');
}
return num;
}
void PrintRadix(int n, int b) {
int radix[20];
... | ALGO | 0.999882 | 3.976494 | {
"github_metadata": {
"branch": "main",
"commit_count": 1727,
"repo_created_at": "2024-10-20T16:39:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0888d7f73... |
048e3d6a-177d-40a2-a78f-49cc9be9a62a | dojiaruninsilence/doobGrooveTestSynth | Source/Utils/DoobMath/DDsp/DConvolution.cpp | /*
==============================================================================
DConvolution.cpp
Created: 7 May 2024 3:33:58pm
Author: Zubin
==============================================================================
*/
#include "DConvolution.h"
#include "DFft.h"
#include "../DGeneralMath/DVe... | ALGO | 0.996024 | 7.220077 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-05-02T19:27:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56a6b37ac1b... |
ec20f866-b284-402d-bac0-e3a5a29c4d22 | ytpub01/pde | Assignment7/Assign7.cpp | //
//#####################################################################
// Assign7.cpp
//#####################################################################
//
// This program computes the exact solution to
//
// u_t + a u_xx = 0
//
// for xA <= x <= xB, 0 <= t <= tFinal with
// u(0... | ALGO | 0.999926 | 4.535258 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-20T22:51:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fb95c06c4... |
80c0f615-9603-4a95-addb-5a0371fe50bc | Penn000/ACM | kuangbin带你飞/kb11网络流/O.cpp | //2017-08-25
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
const int N = 5010;
const int M = 500000;
const int INF = 0x3f3f3f3f;
int head[N], tot;
struct Edge{
int next, to, w;
}edge[M];
void add_edge(int u, int v, int w){
edge[tot].w = w;
edge... | ALGO | 0.999901 | 4.243478 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-07-08T14:31: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": "6efc9ca305... |
16a5f8aa-6903-433e-b781-2c0a9b086c43 | madhavkataria1010/DSA-HW | Lab5/8.cpp | #include <iostream>
using namespace std;
class ListNode {
public:
int val;
ListNode* next;
ListNode(int data) {
val = data;
next = nullptr;
}
};
// Split the list into two halves using slow and fast pointers
ListNode* getMiddle(ListNode* head) {
if (!head) return head;
ListN... | ALGO | 0.999997 | 6.107575 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2025-01-24T12:04:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f6fd77dda1... |
d0c70914-d6d5-46d7-9804-4f900eed64ed | Divya063/programming | codeforces/575/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define dd double
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
const int num = 2e5;
struct node{
int u,v;
ll w;
}e[num];
bool comp(node a, node b){
return a.w < b.w;
}
vector<ll> ans;
map<ll, list... | ALGO | 0.999952 | 3.837757 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-01T05:52: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": "f9820c8b07... |
bfe6be32-8a59-46e2-8a09-8938e4db5d17 | vhbb/cmssw | SLHCUpgradeSimulations/Geometry/src/DDPixBarStackTrigLayerAlgo.cc | ///////////////////////////////////////////////////////////////////////////////
// File: DDPixBarStackTrigLayerAlgo.cc
// Description: Make one stack trig layer of pixel barrel detector
///////////////////////////////////////////////////////////////////////////////
#include <cmath>
#include <algorithm>
#include "FWCo... | TOOL | 0.900562 | 5.017618 | {
"github_metadata": {
"branch": "vhbbHeppy80X",
"commit_count": 163384,
"repo_created_at": "2013-07-23T13:22:20.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "cms-sw/cmssw",
"stars": 4,
"forks": 5,
"issues": 19,
"pull_requests": 6
},
"file_meta": {
"cont... |
7a019259-3085-45d5-8ba4-c105b528e887 | ka-bu/gmm-laboratory | src/algorithm/gmm/init_algo/alternating_adaptivemeans_means2gmm_initalgo.cpp | #include "alternating_adaptivemeans_means2gmm_initalgo.h"
#include "../init/alternating_adaptivemeans_means2gmm.h"
#include "../lloydsforgmm.h"
#include "../../../base.h"
#include "../../../settings/settings.h"
const std::string AlternatingAdaptiveMeans2GMMAD::CLASSTAG = "Alt_AdaptMean+Means2GMM";
AlternatingAdaptiv... | ALGO | 0.9987 | 5.866518 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-09-07T11:07:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9013af7982... |
84269ac5-10ac-40a3-b340-f5702a8e679d | sekiya9311/Programming-Contest | codeforces/CFR#449/C.cpp | #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <uno... | ALGO | 0.999883 | 3.747877 | {
"github_metadata": {
"branch": "master",
"commit_count": 469,
"repo_created_at": "2016-06-19T09:44:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9422368e... |
1963bb70-ff4f-4e44-9baa-33be85788096 | ChetanPatel1999/CPP_630 | 72_pointer.cpp | // how to crete object array dyanimacally
#include <iostream>
using namespace std;
class emp
{
int id;
float sallary;
public:
void setdata(int a, float b)
{
id = a;
sallary = b;
}
void display()
{
cout << "emp info ..." << endl;
cout << "Id : " << id << endl;... | TOOL | 0.920337 | 3.563368 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-07-18T13:11: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": "75d8e998f9d... |
11cdc597-8349-480a-99d2-a125ac854352 | kritika0598/codes | dp/165E.cpp | /*
// Sample code to perform I/O:
gjtgn
ciuiuyewiun >> name; // Reading input from STDIN
cout << "Hi, " << name << ".\n"; // Writing output to STDOUT
AHEHFUH
// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
*/
// Write your code jhdsfrhgk... | ALGO | 0.999534 | 3.837733 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-30T16:16: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": "cdc629aedf... |
288c0760-2109-44ba-a8d8-75076dea6d6d | chu-siang/problem_solve | Codeforces/CF1519D.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN = 2e5 + 10;
ll a[MAXN] = {0}, b[MAXN] ={0};
ll pre[MAXN] = {0},suf[MAXN] = {0};
int main(){
int n;
cin >> n;
ll ans = 0;
for(int i = 2; i <= n * 2; i+=2) cin >> a[i];
for(int i = 2; i <= n * 2; i+=2){
cin >> b... | ALGO | 0.99998 | 3.209538 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2023-07-09T15:41: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": "ba7011dc6bd... |
3b34a713-2384-46bf-98a2-f24a59173695 | Samir129/Algorithms | Sorting/quick_sort.cpp | #include<bits/stdc++.h>
using namespace std;
int partition(vector<int> &a, int l, int r, int pivot){
int i = l - 1;
int j = l;
for(int k = l; k < r; ++k){
if(a[k] >= a[pivot]) j++;
if(a[k] < a[pivot]){
swap(a[k], a[++i]);
}
}
swap(a[pivot], a[++i]);
... | ALGO | 0.999876 | 5.09085 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-08-22T18:35:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01f0bf9bb3d... |
e86d3e06-70bf-43d1-b8b7-9427c2461a53 | Ashish-Chokhani/Competitive_Programming | Codeforces/x.cpp | #include<bits/stdc++.h>
using namespace std;
int minimumSwaps(vector<int>& arr) {
int n = arr.size();
vector<int> sortedArr(arr);
sort(sortedArr.begin(), sortedArr.end());
vector<bool> visited(n, false);
int swaps = 0;
for (int i = 0; i < n; i++) {
if (visited[i] || arr[i] == sortedArr... | ALGO | 0.999984 | 4.588024 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-03-17T11:31:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97298477149... |
d4c51bd4-8aef-4d07-8768-cd64a644c1c7 | IgorPBorja/competitive-programming | problems/GruPro/regional-2024/L.cpp | // #define TESTCASES
// #define DEBUG
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>
#define vvi vector<vector<int>>
#define vvb vector<vector<bool>>
#define vvc vector<vector<char>>
#define vvpi vector<vector<pair<int, int>>>
#define pii pair<int,... | ALGO | 0.999936 | 4.24398 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-10-21T17:25: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": "2f75dd420f2... |
584b381a-877d-488b-b71b-ed91088a1494 | Kei18/pibt2 | pibt2/src/problem.cpp | #include "../include/problem.hpp"
#include <fstream>
#include <regex>
#include "../include/util.hpp"
Problem::Problem(std::string _instance, Graph* _G, std::mt19937* _MT,
Config _config_s, Config _config_g, int _num_agents,
int _max_timestep, int _max_comp_time)
: instance(_inst... | ALGO | 0.962753 | 5.348829 | {
"github_metadata": {
"branch": "public",
"commit_count": 253,
"repo_created_at": "2021-08-02T12:15:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 78,
"forks": 38,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d57218... |
4486231e-421c-440e-a091-06d6db653c56 | ozzi17/itp | maio2025/mc1/cesar.cpp | #include <cctype>
#include <iostream>
#include <string>
using namespace std;
int main() {
int deslocamento;
string texto;
getline(cin, texto); // recebe a linha de texto
cin >> deslocamento; // recebe o deslocamento da cifra
deslocamento =
deslocamento % 26; // garante que o deslocamento esteja no... | ALGO | 0.999778 | 4.263792 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2025-04-18T15:58:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "849e8258746... |
10ad3c87-256d-45da-84c3-b07cc786870b | Jaygaur99/DS-Algo-Practice | Coding Minutes/Graph/8_shortest_path.cpp/bellmanFord.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for(int i=m; i<n; i++)
vector<int> bellman_ford(int n,int src,vector<vector<int> > edges){
// create a vector
vector<int> dist(n+1, INT_MAX);
dist[src] = 0;
// relax all edges V-1 times
rep(i, 0, n-1){
for(auto edge : edges){
... | ALGO | 0.99999 | 4.341178 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-04-18T06:08:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a5a0902f133... |
cd89375d-db2f-4499-9b03-baf73855aed9 | ishandutta2007/codeforces-a | alex_2oo8/normal/1284/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int MX = 1000001;
int f[MX], cnt[MX];
int main() {
int n;
ignore = scanf("%d", &n);
int good = 0;
for (int i = 0, l, x; i < n; i++) {
ignore = scanf("%d %d", &l, &x);
bool dec = true;
f[i] = x;
for (int j = 1, y; j < l; j++) {
ignore = scanf("%... | ALGO | 0.99974 | 3.260881 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "bf25d6b832f2... |
7e8b209f-708a-4f5f-a90b-1d1c5661844a | xryuseix/SA-Plag | test/training_data/plag_original_codes/06_051.cpp | // 引用元 : https://atcoder.jp/contests/abc126/submissions/8549418
// 得点 : 600
// コード長 : 849
// 実行時間 : 25
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int M, K;
cin >> M >> K;
if(K == 0){
for(int i = 0; i < (1<<M); ++i){
cout << i << " " <<... | ALGO | 0.999791 | 4.027129 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-01-20T18:36:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee5a385b... |
ddb5244f-dc44-4f9c-a12e-7d066671a550 | JNRCHAYAN/Data-structures-and-algorithms | Search/Binary search.cpp | #include <stdio.h>
int main()
{
int i, l, u, middle, n, search, array[100];
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for (i= 0; i < n; i++)
{
scanf("%d", &array[i]);
}
printf("Enter value to find\n");
scanf("%d", &search);
l... | ALGO | 0.999856 | 3.538575 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2024-07-11T11:40:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b85c8317... |
3e7cd2af-4590-4ab3-a5df-3d86f29e8480 | snigdha920/Codeforces-edu-solutions | Pair Selection-Step-4-C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
vector<pair<int, int>> p;
int n, k;
bool good(double x) {
vector<double> m(n);
for (int i = 0; i < n; i++) {
m[i] = p[i].first - x*p[i].second;
}
sort(m.begin(), m.end());
double sum = 0;
for(int i=n-1; i>=n-k; i-... | ALGO | 0.999972 | 4.559987 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2020-11-11T19:17:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7ae1c826ae0... |
6ec716f8-d787-44a8-9704-79b587135338 | ishandutta2007/codeforces-p | peter50216/normal/95/B.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <iostream>
#define N 100010
using namespace std;
string gen( int n, string s ) {
string ret;
while ( n-- ) ret+=s;
return ret;
}
int d4[N],d7[N];
int main()
{
string s;
cin>>s;
int n=s.size();
d4[n]=d7[n]=n;... | ALGO | 0.999964 | 3.656905 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "5771a2a57b06... |
5645bb0f-103a-459b-8fb0-83ba290a8378 | sukharev/ucd | vol_rend_proj/pm_hist.cpp | /* Histogram.
* Author: <NAME>
* Version: April 2004
* License: GNU GPL
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include "pm_hist.h"
#define HIST_DEBUG 0
/*
* Use:
* 1. set bins for number of bins
* 2. set logbase=0 for equidistant linear range, otherwise to log base
... | ALGO | 0.998898 | 4.795856 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-05-08T23:43:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19f0d868a3... |
e1c9f046-7666-415c-b457-61c9f8ad2c17 | EugeneCho/a1final | a1q2.cpp | #include <iostream>
#include "a1q2.h"
using namespace std;
bool candidate(int array[], int& _candidate, int sz){
//int counter;
int arr1[25];
int count = 0;
// If there are more than two data
if (sz > 1){
if (sz % 2 != 0)
_candidate = array[sz - 1];
for (int i = 0; i < sz-1; i += 2){
if (array... | ALGO | 0.999838 | 4.521472 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-02-23T21:07:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "faab22f2c1... |
0387c250-07ba-4a08-ad1a-5125cae2e30d | ardamavi/cpp | basit-xox-game.cpp |
// <NAME> - <EMAIL>
#include <iostream>
using namespace std;
char zemin[5][5] = {{'1','|','2','|','3'},
{'-','|','-','|','-'},
{'4','|','5','|','6'},
{'-','|','-','|','-'},
{'7','|','8','|','9'}};
char oyuncu[2] = {'X','O'};
int yer... | ALGO | 0.999156 | 3.891534 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-06-25T17:22:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57aac80c38... |
be7e65a5-e4c6-4a5c-a2d3-01434acf0669 | JasprW/CodingInterviews | 52-Match.cpp | #include <iostream>
using namespace std;
class Solution {
public:
bool match(char* str, char* pattern) {
if (*str == 0 && *pattern == 0) {
return true;
} else if (*str != 0 && *pattern == 0) {
return false;
}
if (*(pattern + 1) != '*') {
if (*... | ALGO | 0.999084 | 4.790788 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-03-01T12:27:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7ee8bef2... |
4f764b25-6866-40fd-9d8a-5a5d8ec67e39 | jo3yz/recipes | algorithm/binarytree/traverse.cpp | //
// Created by joey on 4/7/20.
//
#include "binarytree/traverse.h"
void postOrder(TreeNode *root)
{
if(root == NULL)
{
return;
}
postOrder(root->left);
postOrder(root->right);
cout<<root->val<<",";
}
void nonRecursivePostOrder(TreeNode *root)
{
if(!root)
return;
st... | ALGO | 0.999658 | 6.494903 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-03-14T09:57:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18b43987f... |
825b13df-6c01-4196-97f5-b069c190c6fc | gejx2010/kickstart_projects | TidyNumbers/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <map>
#include <stack>
#include <queue>
#include <cassert>
#include <tuple>
#include <set>
#include <climits>
#include <numeric>
using namespace std;
typedef lo... | ALGO | 0.999041 | 3.904834 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2018-09-29T08:20: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": "8ee9b56cd... |
649d0842-f04d-479c-a416-c34ce3a52ed6 | ValveSoftware/source-sdk-2013 | src/game/server/tf/bot/behavior/tf_bot_seek_and_destroy.cpp | //========= Copyright Valve Corporation, All rights reserved. ============//
// tf_bot_seek_and_destroy.h
// Roam the environment, attacking victims
// <NAME>, January 2010
#include "cbase.h"
#include "tf_player.h"
#include "tf_gamerules.h"
#include "team_control_point_master.h"
#include "bot/tf_bot.h"
#include "bot/b... | ALGO | 0.996231 | 5.970788 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2013-06-26T22:21:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9165,
"forks": 2667,
"issues": 352,
"pull_requests": 507
},
"file_meta": {
"content_id": ... |
2c3a8b44-c713-4fe0-8e70-1944a4692574 | chien-yu/algorithm_problems | pacific_atlantic_water_flow_417.cpp | class Solution {
public:
vector<vector<int>> pacificAtlantic(vector<vector<int>>& heights) {
// search from PO
m = heights.size();
n = heights[0].size();
vector<vector<int>> t = { {1,0}, {-1,0},{0,1},{0,-1}};
directions = t;
// -1, visiting
// 0, unvisit
... | ALGO | 0.999985 | 6.375421 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-05-08T22:32: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": "8afdfdee2... |
9d46a4b3-df6e-4d24-9fba-d611a0524cdc | ishandutta2007/codeforces-b | bohdanpastuschak/normal/983/A.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
typedef double LD;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LD, LD> PDD;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VLL;
#define MP make_pair
#define PB push_back
#define ... | ALGO | 0.999305 | 5.394281 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c376b7087a4... |
d85ce312-a3e3-445e-afb6-e60c71f177c1 | rajat-12-jadon/GFG-Questions | integerToRoman.cpp | class Solution {
public:
string intToRoman(int num) {
string thousands[] = {"", "M", "MM", "MMM"};
string hundreds[] = {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"};
string tens[] = {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};
string ones[] = {"", "I",... | ALGO | 0.99944 | 6.091789 | {
"github_metadata": {
"branch": "main",
"commit_count": 175,
"repo_created_at": "2024-11-03T11:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e243bc6d9a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.