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 |
|---|---|---|---|---|---|---|---|
1cd643f5-9b81-4491-8c83-f4605d4a1cae | Ranssuu/Microcontroller-Lab | Practical Exam/Codes/Act 2/Topic 3/Topic3/Topic3.ino |
int t = 0;
void setup()
{
for(int x = 2 ; x<=12 ; x++){
pinMode(x,OUTPUT);}
pinMode (2 , OUTPUT);
pinMode (3 , OUTPUT);
pinMode (4 , OUTPUT);
pinMode (5 , OUTPUT);
pinMode (6 , OUTPUT);
pinMode (7 , OUTPUT);
pinMode (8 , OUTPUT);
pinMode (9 , OUTPUT);
pinMode (10 , OUTPUT);
pinMode (11, OUTPUT)... | ALGO | 0.952156 | 3.349373 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-11-28T12:49:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bf68b374a69... |
b907b028-a482-41b5-8afc-16d25df43a0b | threalwinky/cp_library | vnoj/mmass.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
stack<int> st;
cin >> s;
s = '(' + s + ')';
//cout << s;
int ans = 0;
for (int i=0; i<s.length(); i++){
if (s[i] == '(') st.push(10001);
else if (s[i] == ... | ALGO | 0.999784 | 3.441995 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2022-06-21T15:00:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c26891157f... |
68d1da81-cc8c-4693-8ae5-2b83c32ffe0f | Monathakur803/DSA_loveBabbar | 3,4Patterns/4some_more_patterns/6fancy_p2.cpp | /*
1
2*2
3*3*3
4*4*4*4
5*5*5*5*5 --------
5*5*5*5*5
4*4*4*4
3*3*3
2*2
1
*/
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter the value of n: ";
cin >> n;
// upper half part
for (int row = 0; row < n; row = row + 1)
{
for (int col = 0; col < row + 1; col = col... | ALGO | 0.999975 | 4.328503 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-09-13T10:07: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": "9cb7b1f78ac... |
16fc763c-3e86-4d0e-a557-4bd4f9ca673d | nkits9/DSA-Solved-Problems | c++/Check-if-Linked-List-is-Palindrome.cpp | struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
}
// Hint: Reverse the second half and compare
bool isPalindrome(Node *head) {
if(head->next == NULL) return true;
Node *slow = head;
Node *fast = head;
while(fast->next != NULL... | ALGO | 0.9998 | 4.808961 | {
"github_metadata": {
"branch": "master",
"commit_count": 291,
"repo_created_at": "2020-04-27T14:34:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03d303ad... |
5230046c-4b5e-476a-be1b-f7dae5e6ef9c | jtalman/ual-sandbox | codes/TEAPOT/src/Main/SlidingBumps.cc | #include "SlidingBumps.h"
#include <math.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
typedef unsigned short u_short;
void CorrectorSet::Print(ostream& out, int plane) {
int i;
double str0;
for(i=0; i<corrNumber; i++){
str0 = (plane) ? strength0[i]->ktl(0) : stre... | ALGO | 0.998875 | 3.496571 | {
"github_metadata": {
"branch": "master",
"commit_count": 1290,
"repo_created_at": "2015-10-31T09:25:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7d35bc... |
df922766-1804-4dda-aead-94fe6c4c9414 | ZYYhokkaido/Practice-for-Data-Structure-and-Algorithms | questions.cpp | #include <iostream>
using namespace std;
/*
想好没,写插入的函数
要不你语音我打字,也可以
我这不方便说话,舍友睡觉了
ok
*/
struct ilist{
int *array;
int size;
int capacity;
}
/*
我想下
给点提示
*/
/**
这个是我写的insert,比较简练些.
函数分两步做,找到位置pos(ition),把x插入到pos的位置上.
你可以看一下.
Let me see see
*/
void myinsert(struct ilist *l,int x){
//找到x应该插入的位置
... | ALGO | 0.999339 | 4.191621 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-11-06T03:21: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": "4d386cef06fd... |
b2a3b390-4a6e-4e9c-a34b-737c2b56bfdd | aradzu10/Reversi | src/client/AIPlayer.cpp | /*
ID: 318439981
Name: <NAME>
ID: 315240564
Name: <NAME>
*/
#include "AIPlayer.h"
#include <sstream>
using namespace std;
AIPlayer::AIPlayer(Checker color, const BoardManager& board_, Graphic* graphic_) :
Player(color, graphic_), board(board_) {
}
AIPlayer::~AIPlayer() {
}
Point AIPlayer::GetPointFromPlayer() {
... | ALGO | 0.994162 | 5.074285 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2017-11-27T18: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": "e6394ee7d... |
42636d90-30c9-496f-a0af-76f85776ed51 | moraleseoscar/Parallel_Screensaver | screensaver_parallel3.cpp | #include <SDL2/SDL.h>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <omp.h>
// Funcion que genera el circulo
void SDL_RenderFillCircle(SDL_Renderer* renderer, int x, int y, int radius) {
for (int dy = -radius; dy <= radius; dy++) {
for (int dx = -radius; dx <= radius; dx++) {
... | TOOL | 0.946216 | 5.57892 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-08-30T10:00: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": "7f17e206642... |
50809940-b089-494e-9170-0b5277bd2bf2 | arash-ha/Cpp | Walking Robot Simulation II.cpp | /*
Walking Robot Simulation II
A width x height grid is on an XY-plane with the bottom-left cell at (0, 0) and the top-right cell at (width - 1, height - 1). The grid is aligned with the four cardinal directions ("North", "East", "South", and "West"). A robot is initially at cell (0, 0) facing direction "East".
The ro... | ALGO | 0.999947 | 5.838844 | {
"github_metadata": {
"branch": "master",
"commit_count": 982,
"repo_created_at": "2019-10-02T15:30: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": "ca829599... |
f88452df-8f5a-4762-beb1-d36b183a28b1 | cihati/interview | kth_node_from_end.cpp | #include <cstdio>
#include <cassert>
using namespace std;
struct Node {
int val;
Node* next;
Node(int val, Node* next) : val(val), next(next) { }
};
void insertToHead(Node **root, int val) {
*root = new Node(val, *root);
}
void printNodes(Node* root) {
while (root) {
printf("%d ", root->val);
root = root->n... | ALGO | 0.999543 | 4.590817 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2012-07-29T10:39:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63ef3fdae4... |
c7f456c8-fee0-4cba-b3d7-5af10e55598e | ishandutta2007/codeforces-r | rns_mhb/normal/1010/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 1000010
int u[N], v[N], b[N], d[N];
char c[N];
bool vis[N];
void dfs(int x) {
vis[x] = 1;
if(c[x] == 'I') return;
if(c[x] == 'A') {
if(!vis[u[x]]) dfs(u[x]);
if(!vis[v[x]]) dfs(v[x]);
b[x] = b[u[x]] & b[v[x]];
}
if(c[x... | ALGO | 0.999531 | 3.835362 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "23bcba628fd4... |
4fd438e2-9dd0-4c83-b84d-f508bfbb36ed | Liuweiming/ACH_poker | third_party/open_spiel/algorithms/external_sampling_mccfr.cc | // Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
//
// 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 require... | ALGO | 0.999381 | 6.723871 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-02-16T14:01:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a74dfa2e93... |
ba37e974-4e47-48c0-b8a0-1434cd35319d | Wsh7Ash/LEETCODE | cpp/c0-500/101-150/133.cpp | #include <vector>
#include <unordered_map>
using namespace std;
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> neighbors;
Node(int _val) {
val = _val;
neighbors = vector<Node*>();
}
};
class Solution {
public:
Node* cloneGraph(Node* node) {
if (!node... | ALGO | 0.999939 | 7.104537 | {
"github_metadata": {
"branch": "master",
"commit_count": 365,
"repo_created_at": "2025-03-26T15:51:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40887641... |
ed7e5876-2e7d-4bb5-9c18-2efeab9e0b76 | star-bnl/star-sw | StRoot/StDbLib/StHyperHashMd5.h | /* Declaration of functions and data types used for MD5 sum computing
library functions.
Copyright (C) 1995-1997,1999,2000,2001,2004,2005,2006,2008
Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify it
under t... | ALGO | 0.993324 | 6.526546 | {
"github_metadata": {
"branch": "main",
"commit_count": 38269,
"repo_created_at": "2020-11-12T22:30:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 66,
"issues": 9,
"pull_requests": 29
},
"file_meta": {
"content_id": "81f574... |
7878ad63-8158-4e22-9b8d-363fea7070a3 | immarianaas/cpp-essential-training | session-02/ex_4.cpp | /**
* @file
* @brief Resolution of the fourth exercise.
*
* The goal was to explore the use of functions and
* string manipulation.
*/
#include <iostream>
using namespace std;
/**
* @brief solves the first exercise (a)
*
* Counts the number of alphabetic characters in a string
*
* @param s string to ... | ALGO | 0.996355 | 4.293538 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-11-15T01:43: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": "b7542e9b1886... |
b1bdc6dd-3e0a-4366-9fff-eeee1947a814 | Chi-O/CSCI1061U-exercises | week 9 - namespaces and STLs/take-home exercises/Queue.cpp | #include <iostream>
#include <vector>
using namespace std;
template <class T>
class Queue
{
private:
vector<T> q;
int size;
public:
Queue(T size)
{
this->q;
this->size = size;
}
void addToQueue(T e)
{
q.push_back(e);
}
void removeFromQueue()
{
... | TOOL | 0.953625 | 4.856806 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-01-26T19:23:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "600d800b7fe... |
502fa596-c0c7-4d32-a480-e0d79ddd94ad | anishgupta675/FINAL450 | Graph/Implement_Bellman_Ford_Algorithm/main.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int isNegativeWeightCycle(int n, vector<vector<int>>edges){
// Code here
int m = edges.size();
int inf = 10000000;
vector<int> dist(n, inf);
dist[0] = 0;
fo... | ALGO | 0.999951 | 5.560734 | {
"github_metadata": {
"branch": "master",
"commit_count": 510,
"repo_created_at": "2022-03-07T11:58: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": "f9b707fc... |
6fd95ea0-0461-4537-ad7b-857f2d898d6d | ishandutta2007/codeforces-u | um_nik/normal/711/B.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N = 2020;
int n;
ll a[N][N];
bool check()
{
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (a[i][j] <= 0)
return false;
ll sum = 0;
for (int i = 0; i < n; i++)
s... | ALGO | 0.999963 | 3.360851 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7943eabcf1ab... |
4522a435-8b1a-4825-ad96-df9a4395324e | medkan01/PPIL_L3 | Client/Forme/Polygone.cpp | #include "Polygone.h"
#include "../Visitor/VisiteurForme.h"
void Polygone::ajouterPoint(const Vecteur2D& p) {
points.push_back(p);
points = tri_fusion(points);
centre = Vecteur2D(abcisseCentre(), ordonneeCentre());
}
Polygone::Polygone(const Couleur& c, const Repere& r, const vector<Vecteur2D>& listePoints) {
cou... | TOOL | 0.937875 | 4.340499 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2021-12-03T12:07:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af495876... |
c7888c2c-f2a0-4a45-820a-af5f8f9937bd | angelxlakra/codeforces | #636/B_Balanced_Array.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ios::sync_with_stdio(0);
ll t;
cin >> t;
while (t-- > 0) {
ll n;
cin >> n;
if ((n / 2) % 2 == 1) {
cout << "NO" << endl;
} else {
cout << "YES" << endl;
... | ALGO | 0.999435 | 4.245965 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2020-04-17T07:24: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": "e363a7278... |
cf8e9ed6-3d7b-43f8-ae97-b967d1364522 | alexliniger/MPCC | C++/Cost/cost.cpp | // Copyright 2019 <NAME>
// 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 law or agreed to in writing, so... | ALGO | 0.993898 | 4.532095 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-10-01T08:46:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1547,
"forks": 390,
"issues": 3,
"pull_requests": 4
},
"file_meta": {
"content_id": "27ba... |
66620ee1-189f-4c27-9da3-4c4b9f97e77b | ompl/ompl | src/ompl/base/goals/GoalRegion.h | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2008, <NAME>, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* ... | TOOL | 0.919032 | 7.105545 | {
"github_metadata": {
"branch": "main",
"commit_count": 4948,
"repo_created_at": "2014-05-20T14:22:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1776,
"forks": 636,
"issues": 80,
"pull_requests": 28
},
"file_meta": {
"content_id": "fce... |
64989888-2913-48ff-8f45-be61a641b64c | VermennikovMV/MAI_OS_Labs | Lab1/src/main.cpp | #include <iostream>
#include <vector>
#include <unistd.h>
#include <sys/wait.h>
#include <fcntl.h>
int main() {
int fd1[2], fd2[2];
if (pipe(fd1) == -1 || pipe(fd2) == -1) {
std::cout << "Ошибка при создании pipe";
return 1;
}
pid_t pid = fork();
if (pid < 0) {
std::cout <<... | ALGO | 0.998879 | 4.270307 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-09-07T17:09: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": "ca8559f5aac... |
c435ba24-3c22-4df7-a0de-3928b39edf3b | Haduckientechnology17092005/ADA | dp/matrixchain.cpp | #include <iostream>
#include <iomanip> // Để sử dụng setw
#include <climits> // Để sử dụng INT_MAX
using namespace std;
// Hàm tính toán số phép nhân tối thiểu
int MatrixChainOrder(int p[], int n)
{
int dp[n][n];
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
dp[i][j] = 0;
}
}
// Gán giá trị 0 cho ... | ALGO | 0.999983 | 4.792454 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-12-12T16:13: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": "4f3cc208570c... |
a6155fab-b441-4af9-8113-a12eefcf6240 | hongmengshikong/Crypto | RSA/MainRSA.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include "RSA.h"
using namespace std;
int main() {
// 创建RSA对象,自动生成密钥对
RSA rsa;
string input;
cout << "请输入要加密的字符串: ";
getline(cin, input);
// 加密
vector<long long> cipherText = rsa.Encrypt(input);
// cout << "加密... | TOOL | 0.989086 | 4.820783 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-06-09T03:19:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39d6f77acf8... |
1a6afe14-b579-4708-8af8-ca0392a6c626 | Tipriest/AlgorithmPractice | leetcode/dynamicPlanning/3333.cpp | #include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <stack>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
const int mod = 1e9 + 7;
public:
int possibleStringCount(string word, int k) {
// cout << mod << endl;
int n = word.size();
if... | ALGO | 0.999995 | 5.471485 | {
"github_metadata": {
"branch": "main",
"commit_count": 113,
"repo_created_at": "2023-10-13T00:05:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1ce96e042... |
cf9b6e39-a959-4225-b575-b1a8176e147a | arvidn/libtorrent | src/ed25519/sc.cpp | // ignore warnings in this file
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include "fixedint.h"
#include "sc.h"
static u64 load_3(const unsigned char *in) {
u64 result;
result = (u64) in[0];
result |= ((u64) in[1]) << 8;
result |= ((u64) in[2]) << 16;
return result;
}
static u64 load... | ALGO | 0.998814 | 3.372807 | {
"github_metadata": {
"branch": "RC_2_0",
"commit_count": 13881,
"repo_created_at": "2015-06-03T05:22:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5609,
"forks": 1040,
"issues": 197,
"pull_requests": 33
},
"file_meta": {
"content_id"... |
d5d528d5-5271-466e-8b7f-59b6fdc7808d | paulot/interview | xMatrix.cpp | // Given a matrix of bits, print the size of the biggest X on the matrix
#include <iostream>
using namespace std;
void printMatrix(int **matrix, int m, int n) {
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++)
cout << matrix[i][j] << " ";
cout << endl;
}
cout << endl;... | ALGO | 0.999868 | 4.638299 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-07-27T02:10:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31a860e2a9... |
0dfc4fdd-2fc3-4924-8f5d-24d1237cf94a | nafiulaziz/Codes_in_Cplusplus | Stack.cpp | #include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<conio.h>
using namespace std;
class Stack
{
private:
int arr[5];
int top;
public:
Stack()
{
top = -1;
for(int i = 0; i < 5; i++)
{
arr[i] =0;
}
}
bool isEmpty()
{
if(top == -1)
... | ALGO | 0.973184 | 3.737849 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-30T05:46: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": "3efeb70f3479... |
83866266-aa8e-45d4-8e0b-0adf09a015d2 | PJ-Leyden/cs_projects | cs3/svn/Lab2/word_count.cpp | //File: word_count.cpp
//Code by: <NAME>
//Date: Jan 22nd, 2019
#include "word_count.hpp"
WordOccurrence::WordOccurrence(const std::string& word, int num):word_(word), num_(num){}
bool WordOccurrence::matchWord(const std::string& rhs){
return (word_ == rhs);
}
void WordOccurrence::increment(){
++num_;
}
std::s... | TOOL | 0.959265 | 4.989989 | {
"github_metadata": {
"branch": "master",
"commit_count": 141,
"repo_created_at": "2018-09-22T17:32:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22c45a46... |
f5b6fec8-72c5-4a9a-bf21-d40a3ba7a201 | yuya-s/CPQ-aware-index | constructing_index/construct_iapathindex/index.cpp | //
// Created by sasaki on 19/03/11.
//
#include "index.h"
#include "pathset.h"
PathIndex::PathIndex(PathSet& k_pathset){
struct timespec index_startTime, index_endTime;
long double responseTime;
k=k_pathset.k;
labelnum=k_pathset.number_of_labels;
hash_labelid2index.set_empty_key(-1);
hash_i... | ALGO | 0.952277 | 4.397653 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-02-10T12:28: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": "41defaae605... |
b20764ef-ecbf-42ab-be7c-9131ec8260cb | kaskr/adcomp | TMB/inst/include/tiny_ad/bessel/bessel.hpp | #ifndef TINY_AD_BESSEL_H
#define TINY_AD_BESSEL_H
#include "undefs.h" // Rcpp
/* Standalone ? */
#ifndef R_RCONFIG_H
#include <cmath>
#include <iostream>
#include <float.h> // INFINITY etc
#include <stdlib.h> // calloc (bessel)
#undef R_PosInf
#undef R_NegInf
#undef F77_NAME
#undef FALSE
#undef TRUE
#undef R_NaN
#und... | TOOL | 0.992916 | 4.310174 | {
"github_metadata": {
"branch": "master",
"commit_count": 1543,
"repo_created_at": "2013-09-10T12:37:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 187,
"forks": 85,
"issues": 68,
"pull_requests": 4
},
"file_meta": {
"content_id": "902... |
87e9d6fc-567f-47fa-8b3b-03ccb65257e1 | savnani5/Data-Structures-and-Algorithms | recursion/p2.cpp | // Coin game: Alice and Bob are playing a game
// using a bunch of coins. The players pick several coins out of the
// bunch in turn. Each time a player is allowed to pick 1, 2 or 4 coins,
// and the player that gets the last coin is the winner. Assume that
// both players are very smart and he/she will try his/her bes... | ALGO | 0.999847 | 4.633093 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-06-19T21:31: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": "a88e9ddae3c... |
221b87e7-dbe5-4f7e-9088-48d9d53da282 | OmerCohen7530/MST-Server-Thread-Pool-Multithreading | mst.cpp | #include "mst.hpp"
#include "prim.hpp" // Include the Prim's algorithm header
#include "boruvka.hpp" // Include the Boruvka's algorithm header
#include <limits>
#include <queue>
#include <string>
#include <iostream>
// Constructor
MST::MST(const std::vector<std::vector<int>>& graph, int n, const std::string& a... | ALGO | 0.999847 | 6.233357 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-11-12T17:31: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": "fccae04f157... |
a45f3aea-a8f1-4ee0-b548-6875b961c28b | adnanaziz/EPIJudge | epi_judge_cpp_solutions/minimum_points_covering_intervals.cc | #include <algorithm>
#include <iterator>
#include <limits>
#include <vector>
#include "test_framework/generic_test.h"
#include "test_framework/serialization_traits.h"
using std::numeric_limits;
using std::vector;
struct Interval;
struct Interval {
int left, right;
};
int FindMinimumVisits(vector<Interval> interv... | ALGO | 0.999406 | 6.326725 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
1e59c4e0-ee9e-4032-8bf6-bb16afb68226 | huangzhemin/LeetCode | 6 ZigZag Conversion.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <sstream>
#include <map>
#include <set>
using namespace std;
typedef struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
} TreeNode;
... | ALGO | 0.999993 | 4.861986 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-07-17T11: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": "325b7d64f... |
c7d81e13-457e-44ec-ba09-9c08af5378a6 | MinHanLiWesley/ada | code/hw1/Q4/yiyan.cpp | #include <iostream>
#include <vector>
#ifdef DEBUG
#include <cassert>
#endif
using namespace std;
#define DTYPE long long
#define POS 1
#define NEG 0
/* treat zero as negative */
DTYPE N;
int flag;
struct element
{
int index;
DTYPE data;
};
#ifdef DEBUG
void output_table(vector<element> &table)
{
for (in... | ALGO | 0.999983 | 3.435775 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-12-07T10:09:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a562a4265c... |
ce805c93-fb0a-48a4-b762-4dd290eee5cd | shuvokr/Solution_for_UVA_OnlineJudge_Problems | 10523.cpp | /*
Shuvo
10523
*/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <stdlib.h>
#include <stack>
#include <vector>
#include <queue>
#include <list>
#include <string>
#include <sstream>
#include <iostream>
#include ... | ALGO | 0.999975 | 3.417659 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-08-14T01:11: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": "4c4ea461b... |
dfdd8bc4-3ab2-48a8-9aa2-e08766ebcf07 | PranavNyati/CS39002-Operating-Systems-Lab | asgn2_custom_Unix-based_shell/code/shell_main.cpp | #include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <set>
#include <vector>
#include <iostream>
#include <signal.h>
#include <stack>
#include <fcntl.h>
#include "parser.h"
#include "editing.h"
#include "utils.h"
#include "io_redirect.h"
#include "sb.h"
#define... | TOOL | 0.92964 | 3.159465 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-01-14T13:25: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": "66abdf9f2dd... |
a5bb043d-1033-4eb6-817f-514deab4307c | llvm-mirror/llvm | lib/CodeGen/MachinePipeliner.cpp | //===- MachinePipeliner.cpp - Machine Software Pipeliner Pass -------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.98615 | 4.214916 | {
"github_metadata": {
"branch": "master",
"commit_count": 186941,
"repo_created_at": "2012-01-27T23:49:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4612,
"forks": 2086,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
07c453e6-eb45-4d23-88c4-fd6f1d5ea3e9 | Gencho-Zhilkov/fmi-ip-group-7-2022 | 2022-11-14/exercise_4.cpp | #include <iostream>
unsigned pow(unsigned n, unsigned k) {
unsigned res = 1;
for (unsigned i = 0; i < k; i++) {
res *= n;
}
return res;
}
unsigned sumDigits(unsigned n) {
unsigned res = 0;
while (n > 0) {
res += n % 10;
n /= 10;
}
return res;
}
unsigned prodDigits(unsigned n) {
unsigned res = 1;
do ... | ALGO | 0.999937 | 5.668545 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2022-10-10T20:47:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27b07a7feed... |
6d7bf2e7-45db-4dfb-a717-769db517843b | HawkAaron/warp-transducer | tests/test.h | #pragma once
#include <stdexcept>
#include <vector>
#include <limits>
#include <numeric>
#include <rnnt.h>
inline void throw_on_error(rnntStatus_t status, const char* message) {
if (status != RNNT_STATUS_SUCCESS) {
throw std::runtime_error(message + (", stat = " +
... | ALGO | 0.944315 | 6.93599 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2018-04-19T05:05:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 311,
"forks": 126,
"issues": 25,
"pull_requests": 5
},
"file_meta": {
"content_id": "6b90... |
81373609-3258-4c5e-a4d0-ba408e45a0ec | panmari/pbrt_rpf | src/shapes/wavefront.h |
/*
pbrt source code Copyright(c) 1998-2010 <NAME> and <NAME>.
This file is part of pbrt.
pbrt 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 2 of the License, or
(at your... | TOOL | 0.943364 | 6.741282 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2013-05-03T17:34:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe323098... |
cf9b28f4-6d14-41e2-a4bb-a5549d600d2a | KaizynX/Code | Luogu/luogu2657_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
long long a, b;
int dp[10][10], pre[10];
inline void init()
{
for (int j = 0; j <= 9; ++j) dp[0][j] = 1;
for (int i = 1; i < 10; ++i) {
for (int j = 0; j <= 9; ++j) {
for (int k = 0; k <= 9; ++k) {
... | ALGO | 0.99953 | 4.259498 | {
"github_metadata": {
"branch": "master",
"commit_count": 351,
"repo_created_at": "2018-02-19T10:48:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "289c24f2... |
c2e9bc3f-63a1-47f8-ba19-287cadb17463 | tappat225/coding-exercise | Leetcode/Normal/complex-number-multiplication.cpp | /**
* 字符串形式输入两个复数,字符串形式返回它们的乘积。
*
*
* Tags: sscanf应用,格式化输入
* Link: https://leetcode-cn.com/problems/complex-number-multiplication/
*
* Feeling: 自己的想法过于复杂,想着对输入格式做逐个分析
*/
#include "../../Tools_function/head_cpp.h"
using namespace std;
#ifdef SB_METHOD
/* 过于繁琐冗长 */
int sign_count = 0;
struct comlex_num {
... | ALGO | 0.999263 | 5.393859 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-11-25T02:01:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f61b63ea34... |
5c4e73c2-0a42-4668-a20a-32310b6e6cbe | tokitsu-kaze/ACM-Solved-Problems | LeetCode/题库/394. 字符串解码.cpp | #define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typede... | ALGO | 0.999745 | 4.958264 | {
"github_metadata": {
"branch": "master",
"commit_count": 1180,
"repo_created_at": "2018-06-24T10:28:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b62e1bc... |
01b6247f-2608-4e15-8b29-eff58b53df7f | Mohammed-eid35/Aliens-Library | SparseTable/minQuery.cpp | //:::: Alien :::://
// <NAME> //
#include <bits/stdc++.h>
using namespace std;
void Alien35() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("test.in", "rt", stdin);
freopen("test.out", "wt", stdout);
#endif
}
const int N = 1e5 + 5, LG = 17, ... | ALGO | 0.999985 | 4.474556 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-09-18T13:11:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e7a458689... |
d05a9a15-12e0-45d1-a46f-3f1ddbafcf2f | yefantingyu/Dissertation | ACO_version_2022_6_27/Problem.hpp | #include "Macro.hpp"
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<cstring>
#include<math.h>
#include<algorithm>
#include<fstream>
#include<time.h>
#include<limits.h>
#include <vector>
#include <limits.h>
#include <string>
using namespace std;
struct node {
int id;
double x;
... | ALGO | 0.998508 | 3.882619 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-06-18T16:57: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": "980016999bc... |
fe9ccd16-1b1e-4573-a5b7-b1fc48f9ae9d | mel-1804/Algorithms-Data-Struct | 1.3. cost-algorith.cpp | #include <iostream>
#include <vector>
using namespace std;
// DISEÑAR UN ALGORITMO LALMADO TOP QUE ENCUENTRE LA MODA DE UN VECTOR UNIMODAL.
// EL COSTE DEL ALGORITMO DEBE SER COMO MÁXIMO logn, ES DECIR, O(logn).
int top(const vector<int> &v, int l, int r)
{
// caso base cuando size <= 2
if (l + 1 >= r)
... | ALGO | 0.99987 | 3.83412 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2025-03-28T13:57:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9c1b68b1... |
cf6900fe-8631-4532-a333-749493682dfa | ymd45921/HUST-ACM-training | vjudge/2020七月暑假集训/HDU 多校 2020/Day 7/1010.cc | #include <iostream>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <unordered_map>
#include <queue>
using namespace std;
using longs = long long;
using uint = unsigned;
inline longs nextLongs()
{
int f = 0, ch = getchar(); longs x = 0;
while (!isdigit(ch)) ch == '-' && (f = 1), ch = getchar... | ALGO | 0.999286 | 5.070095 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2020-12-02T04:26: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": "b3f27a49... |
0bc69dfc-37d5-4d81-9ba5-6bad9ff80777 | qiuchengw/skiall | third_party/externals/swiftshader/third_party/SPIRV-Tools/source/reduce/reduction_pass.cpp | // Copyright (c) 2018 Google LLC
//
// 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 law or agreed to ... | TOOL | 0.925082 | 7.518475 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2018-07-31T12:50:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 11,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e9b9a127... |
af6c92e1-0c78-4955-a8b4-07406172e3a0 | namvnngu/dev-learning | general/hello-algo/codes-en/cpp/chapter_dynamic_programming/min_cost_climbing_stairs_dp.cpp | /**
* File: min_cost_climbing_stairs_dp.cpp
* Created Time: 2023-06-30
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Climbing stairs with minimum cost: Dynamic programming */
int minCostClimbingStairsDP(vector<int> &cost) {
int n = cost.size() - 1;
if (n == 1 || n == 2)
return c... | ALGO | 0.999981 | 5.772902 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-03-25T23:27: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": "4961bb6e5dc... |
def2141c-6586-4928-8f00-0562e0487bbf | root-project/root | math/genetic/inc/Math/GeneticMinimizer.h | // @(#)root/mathcore:$Id
/**********************************************************************
* *
* Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
* *
* ... | ALGO | 0.988978 | 6.266829 | {
"github_metadata": {
"branch": "master",
"commit_count": 93033,
"repo_created_at": "2013-06-27T10:46:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2899,
"forks": 1363,
"issues": 467,
"pull_requests": 269
},
"file_meta": {
"content_id"... |
beeceaa0-42f3-47b6-ba06-43b541296878 | koosaga/olympiad | ICPC/KAIST/kaist19spring_f.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
using pi = pair<int, int>;
using lint = long long;
using pque = priority_queue<pi, vector<pi>, greater<pi> >;
int n;
int a[MAXN][2];
pque freeQ[2], revokeQ[2];
int used[MAXN];
int main(){
scanf("%d",&n);
for(int i=0; i<2*n; i++){
scanf("%d %... | ALGO | 0.999961 | 3.298589 | {
"github_metadata": {
"branch": "master",
"commit_count": 361,
"repo_created_at": "2015-11-06T16:01:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 285,
"forks": 31,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d559... |
aa91d75f-a1e5-4891-a03f-dc184e647a20 | Justsvetoslavov/Introduction_to_programming | SI/Sem.02/Pract.02/Task06.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
cout << "Finding the root of the equation a * x^2 + b * x + c = 0\n";
double a;
cout << "Enter the value of a: ";
cin >> a;
if (a < 0.00000001)
{
cout << "If a is 0, then this is not a quadratic equation!\n";
return 1;
}
... | ALGO | 0.992348 | 3.415154 | {
"github_metadata": {
"branch": "master",
"commit_count": 501,
"repo_created_at": "2022-10-04T21:35:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 40,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "4aefe3... |
06130f73-d345-48b0-92dc-6c571bab6581 | ArtemAlisov/game-backend | src/collision_detector.cpp | #include "collision_detector.h"
#include <cassert>
namespace collision_detector {
CollectionResult TryCollectPoint(geom::Point2D a, geom::Point2D b, geom::Point2D c) {
assert(b.x != a.x || b.y != a.y);
const double u_x = c.x - a.x;
const double u_y = c.y - a.y;
const double v_x = b.x - a.x;
const ... | ALGO | 0.996515 | 4.873622 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-28T09:52:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2230decb79ca... |
9a974e30-30e3-4b94-b2f9-7b7197276269 | saken03/Competitive-Programming | USACO/2017/February Contest/Problem 3. Why Did the Cow Cross the Road III/countcross.cpp | /***
PROB:
LANG: C++14
username: sakenseri1
***/
#include<bits/stdc++.h>
#define sz(x) (int)(x).size()
#define pb push_back
#define mp make_pair
#define f first
#define s second
typedef long long ll;
using namespace std;
void setIO(string name = "") {
ios::sync_with_stdio(0);
cin.tie(0);
if (!name.empty()) {
... | ALGO | 0.999768 | 4.193231 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2022-12-19T13:35: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": "e3a5d5537... |
f11a17cd-159b-463c-89b8-39bb34eee5aa | eumjeongseok/Project-for-Data-Structure-and-Algorithm | Project for Data Structure and Algorithm/라인편집기.cpp | #pragma once
#include <cstdio>
#include <stdio.h>
#include <cstring>
#include <string.h>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
#define MAX_CHAR_PER_LINE 1000
#pragma warning(disable:4996)
string editorcopy[MAX_CHAR_PER_LINE]; //라인에 입력된 내용 저장하는 문자열 배열
int stringcount = 0; //카운팅 변... | TOOL | 0.952219 | 3.6633 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-07-19T06:49: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": "d3b9ab70c9... |
bca5a941-8532-440e-8d90-c773aa337183 | andremralves/competitiveProgramming | codeforces/round896/c.cpp | /**
* author: mralves
* created: 10-09-2023 10:48:59
**/
#include <bits/stdc++.h>
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()
using namespace std;
using ll = int64_t;
using ii = pair<int, int>;
ll ceil(ll a, ll b) {return a % b == 0 ? a / b : a / b + 1;}
vector<ii> dir4 = {{1, 0}, {0,... | ALGO | 0.999949 | 4.265964 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2022-09-16T06:11:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ff3aafa... |
aeb5f7d8-09c3-41a0-b65d-cdd5620d99e2 | oiu850714/leetcode | 001.cpp | #include <vector>
#include <map>
class Solution {
public:
// note,這個 member function 的 interface 本質上就是錯的
// 應該 return std::vector<size_t>
// 但無法變更 interface,將錯就錯
std::vector<int> twoSum(std::vector<int>& Nums, int Target) {
// assume exactly one solution
// and two numbers are at differ... | ALGO | 0.999421 | 5.592745 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2020-04-03T06:22:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92364bfdc... |
d6e09e04-69d5-4c88-aa3d-1dc71211b114 | Keneyr/LiveCharacter | GenerateOutline/GenerateOutline/SpriteMeshGenerator.h | #pragma once
#include "dynamic_bitset.h"
#include <vector>
#include "Vector2.h"
class SpriteMeshGenerator
{
public:
struct s_cost
{
s_cost() {};
s_cost(float _c, float _w)
{
c = _c;
w = _w;
};
float c;
float w;
};
struct vertex
{
vertex() {};
vertex(Vector2f pos)
{
p = pos;
};
Ve... | ALGO | 0.991658 | 4.539713 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2021-05-03T01:00:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48c33d2834c... |
e5aee879-27b8-43bf-8f14-976ee475c729 | maxshuang/Algorithm-Data-Structure-Practice | algo_ds/leetcode/linked-list/141-linked-list-cycle/main.cpp | /*
Given head, the head of a linked list, determine if the linked list has a cycle in it.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connecte... | ALGO | 0.999835 | 5.685448 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-01-31T07:42: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": "3a0b571d18... |
95863ebc-9a70-4397-9657-eea206b9bce9 | Anupam1337/Goggle-Kick-Start | 2013/Round A 2013/Cross the maze/Solution.cpp | #include<bits/stdc++.h>
using namespace std;
map<char, pair<int, int> > mp;
char getNextDirection(char d) {
if(d == 'N') return 'E';
if(d == 'E') return 'S';
if(d == 'S') return 'W';
return 'N';
}
char getLeft(char d) {
if(d == 'N') return 'W';
if(d == 'E') return 'N';
if(d == 'S') return... | ALGO | 0.999963 | 4.08451 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2022-09-08T09:18:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3541c647ec... |
64af2bac-8a6c-4a5c-8441-96182ea2580b | SDW1014/Study_CPP | Study_CPP/Chatgpt_22.cpp | #include "Chatgpt_22.h"
void stringPrintFunction(string s)
{
cout << s << endl;
}
void checkAndCheck(string s1, string s2)
{
int d = 0;
int roofSize = 0;
string first = s2;
string second = s1;
int stringCheck = 0;
int checkStartNumber = 0;
if (s1.size() >= s2.size())
{
first = s1;
second = s2;
}
for (i... | TOOL | 0.998897 | 4.284801 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-03-22T19:59: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": "11fe08fa8d... |
f0617290-b7dc-410e-91b9-0c77d9ba68bd | pavelsimo/ProgrammingContest | uva/1225_Digit_Counting/P1225.cpp | /* @BEGIN_OF_SOURCE_CODE */
/* @JUDGE_ID: 1225 C++ "Ad Hoc, Math" */
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <deque>
#include <numeric>
#include <iterator... | ALGO | 0.996879 | 3.834507 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-10-16T15:16:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d830a242c... |
64afbc4e-8bed-4e32-95b7-1bb538931ecd | bothemrun/CAP-Complete-Algorithmic-Programming | Leetcode_All_Solved/979.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999988 | 6.20851 | {
"github_metadata": {
"branch": "main",
"commit_count": 1606,
"repo_created_at": "2022-02-13T12:44:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ec04e62e... |
9ae1ee6f-ded1-4d89-8e71-e2f27c924ba2 | samsonwang/ToyCpp | LeetCode/0049/0049_2.cpp |
#include <vector>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
// optimization this
bool isAnagrams(const vector<string>& vec, string str) {
if (vec.empty()) {
return false;
}
const string& base = vec[0];
if (base.size() != str.size()) {
... | ALGO | 0.999994 | 5.846697 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2018-05-16T08:58: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": "639ec41d... |
66815869-4d97-46c7-95a7-56f2f643ba9e | Mythili007/CodePractice | LeetCode/MEDIUM/TREES/rightViewOfBT.cpp | /*
* https://leetcode.com/problems/binary-tree-right-side-view/
* 199. Binary Tree Right Side View
* Given the root of a binary tree, imagine yourself standing on the right side of it,
* return the values of the nodes you can see ordered from top to bottom.
*/
#include <bits/stdc++.h>
using namespace std;
#define fas... | ALGO | 0.999954 | 5.429952 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-06-01T17:47: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": "a7b1cb905... |
09672d9a-600c-42fc-93a3-72c80d65b158 | jazniv/GameOfLife | game.cpp | #include "game.h"
#ifdef _WIN32
#include <Windows.h>
#else
#include <unistd.h>
#endif
Game::Game(int height, int width, float density, int outputType, string outputFile){
generationNum = 0;
m_outputType = outputType;
m_outputFile = outputFile;
currGrid = new Grid(height, width, density);
prevGen1Grid = new G... | ALGO | 0.948981 | 4.576371 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-07-14T14:22:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0096ab01c7a... |
169d991d-8c9d-4e74-a851-a0678695ade9 | Hansil-Chapadiya/Leet_Code_Problems | Easy/FinalArrayStateAfterKMultiplicationOperationsI_3264.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <queue>
class FinalArrayStateAfterKMultiplicationOperationsI_3264
{
private:
/* data */
public:
std::vector<int> getFinalState(std::vector<int> &nums, int k, int multiplier)
{
// for (int i = 0; i < k; i++)
... | ALGO | 0.999965 | 5.368211 | {
"github_metadata": {
"branch": "main",
"commit_count": 616,
"repo_created_at": "2024-09-02T09:51:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fae1a07726... |
437ef73b-001c-46d4-a20f-93710f71fc93 | HaelC/LeetCode | C++/53. Maximum Subarray/sol1.cpp | class Solution {
private:
int maxSubArray(vector<int>& nums, int left, int right) {
if (left == right) {
return nums[left];
}
int mid = left + (right - left) / 2;
int leftPart = maxSubArray(nums, left, mid);
int rightPart = maxSubArray(nums, mid + 1, right);
... | ALGO | 0.999976 | 6.308733 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2019-03-27T03:00:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e01628a... |
22c7a71f-f51e-4713-b014-9c519633e828 | fahimfarhan/coding-creed-origins | Codes/other-ojs/spoj/BYTESM2-PhilosophersStone.cpp | #include <bits/stdc++.h>
using namespace std;
#define si(x) scanf("%d",&x)
#define sf(x) scanf("%f",&x)
#define pi(x) printf("%d\n",x)
#define pf(x) printf("%.4f\n",x)
#define ll long long int
#define sll(x) scanf("%I64d",&x);
#define pll(x) printf("%-I64d\n",x);
#define LOL 5
int n, T, h,w,m;
int **a, **dp;
... | ALGO | 0.999897 | 3.24589 | {
"github_metadata": {
"branch": "dev",
"commit_count": 421,
"repo_created_at": "2018-01-30T13:10:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03ef2ffddd8... |
7d4cdfb3-edb1-480a-97cc-3c8d2808d42c | PhosAQy/Game | Snake/Main.cpp | #include <iostream>
#include <stdio.h>
#include <conio.h>
#include <string>
#include <graphics.h>
#define MAX_SNAKE 500 //蛇的最大节数
#define WIN_WIDTH 640
#define WIN_HEIGHT 480
int COUNT = 0;
using namespace std;
enum DIR
{
UP,
DOWN,
LEFT,
RIGHT,
};
struct Food
{
int x;
int y;
DWORD color;
bool flag; //是否被吃掉,是否... | ALGO | 0.996607 | 4.114294 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-12-13T08:46: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": "bde5cbb5ef... |
448a2068-00ba-457b-9bb1-56846bbe3d64 | hanwoolsky/samsung_pro | pro/자전거대여소.cpp | #include <deque>
#include <queue>
#include <unordered_map>
#include <string>
using namespace std;
#define MAX_CALL (100000)
#define MAX_USER (10000)
#define MAX_N (100)
#define MAX_L (8)
int totalBicycle;
int durTime;
struct BICYCLE
{
int operTime;
int cnt;
BICYCLE* init(int operTime, int... | ALGO | 0.993367 | 4.220236 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2022-11-13T06:06: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": "a8dbdcf0374... |
0a3d8cf2-f112-40bd-886a-a52e3f1b3e5f | OdanBroder/Public-Administrative-Services-via-Citizen-Services-Portal | frontend-ubnd/src/utils/crypto/key_generation.cpp | #include "mldsa_lib.h"
#include <cstddef>
#include <openssl/pem.h>
#include <openssl/ec.h>
#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/types.h>
#include <openssl/x509.h>
#include <openssl/err.h>
#include <iostream>
#include <fstream>
#include <memory>
#include <openssl/x509v3.h>
using BIO_ptr = ... | TOOL | 0.919055 | 5.656804 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2025-05-19T05:18:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18148d43a1a... |
24ea8393-ddee-4e06-849d-9f1a89802cce | freedomDR/coding | codeforces/1189/A/1189-A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
cin.tie(0);
cin.sync_with_stdio(false);
int n; cin >> n;
vector<int> s(n, 0);
for(int i = 0; i < n; i++) {
cin >> s[i];
}
vector<vector<pair<int, int>>> dp(20);
for(int i = 0; i < n; i++) dp[0].push_back(make_pair(s[i], 0... | ALGO | 0.999821 | 4.064179 | {
"github_metadata": {
"branch": "master",
"commit_count": 327,
"repo_created_at": "2019-04-25T10:44:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4524e74... |
9b6cc935-80c8-40a5-9243-1602e4bb529c | db-tu-dresden/CIDR24-SIMD-FPGA | static_tsl/include/generated/definitions/calc/calc_oneAPIfpgaRTL.hpp | /*==========================================================================*
* This file is part of the TSL - a template SIMD library. *
* *
* Copyright 2023 TSL-Team, Database Research Group TU Dresden *
* ... | TOOL | 0.984021 | 6.576308 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-31T06:18:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50008754eab6e... |
d47f2054-b735-41d2-8f23-b4f293685ef8 | relldaXY/straightSelection | straightSelection.cpp | #include <iostream>
using namespace std;
void straightSelection(int *a, int tam);
int main() {
int tam = 10;
int a [10] = {3,2,4,5,1,9,6,7,8};
straightSelection(a, tam);
return 0;
}
/*
we begin when we take the first position to put the smaller number,
after we take the second position to nex... | ALGO | 0.999942 | 4.393981 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-22T01:56: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": "a19014f14b... |
3c2aa754-8ed0-4ef7-ab8e-087b7eb17bc4 | pineal/SC_AI_Flash | ualbertabot-master/UAlbertaBot/Source/DistanceMap.hpp | #pragma once
#include <vector>
#include "BWAPI.h"
namespace UAlbertaBot
{
class DistanceMap
{
int rows,
cols,
startRow,
startCol;
std::vector<int> dist;
std::vector<char> moveTo;
std::vector<BWAPI::TilePosition> sorted;
int getIndex(const int row, const int col) const
{
return ro... | ALGO | 0.999041 | 5.526659 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-24T00:25:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a1b0f3032... |
0eca4ee6-1743-4ed5-9960-0a32ebe4e004 | UvanAdhithya/DSA | Lab_11/a (1).cpp | #include<iostream>
#define SIZE 10
using namespace std;
class Hashtable{
private:
int Table[SIZE];
bool Occupied[SIZE];
int HashFunction(int key){
return key % SIZE;
}
public:
Hashtable(){
for(int i=0;i<SIZE;i++){
Table[i]=-1;
... | ALGO | 0.999407 | 4.285032 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-05-04T16:54:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8eec84e912c... |
183cf575-a6d0-431f-a171-2cd3a3740aac | jgpr-code/katas | cpp/bad_clean_code/mainOOP.cpp | #include <iostream>
#include <vector>
using namespace std;
class Shape
{
public:
virtual double area() const = 0;
};
class Square : public Shape
{
public:
Square(double side) : mySide(side) {}
double area() const override
{
return mySide * mySide;
}
private:
double mySide;
};
class R... | ALGO | 0.990493 | 5.755687 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2022-03-30T07: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": "b25c0bb13e1... |
c43e428b-9256-4a8b-8713-206947f6cb9e | harshvardhan2511/Placement-Revision | Interview_Questions/Sliding_Window_maximum.cpp | /*
Link: https://leetcode.com/problems/sliding-window-maximum/
*/
// TC = O((n-k)*k)
// SC = O(k)
// Optimal
// TC = O((n-k)*log k)
// SC = O(k)
class Solution
{
public:
vector<int> maxSlidingWindow(vector<int> &nums, int k)
{
int n = nums.size();
multiset<int> st;
vector<int> ans;
... | ALGO | 0.999923 | 6.648596 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-05-16T07:49: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": "8ead7f58b9ba... |
6793fb13-8dd6-406f-9f7f-9884a74c22d5 | endeavorHao/algorithm | nowcoder/河南联赛/2023河南联赛VIII/小分分.cpp | #include <bits/stdc++.h>
#define x first
#define y second
#define int long long
#define endl "\n"
#define all(v) v.begin(), v.end()
using namespace std;
const int N = 1000010, INF = 0x3f3f3f3f, mod = 1000000007;
typedef pair<int, int> PII;
int b[N], b2[N];
int qmi(int a, int b){
int ans = 1;
while(b){
i... | ALGO | 0.999924 | 4.346481 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2023-07-15T03:30: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": "7f64257e3d... |
fa832d52-bd2c-483d-bb50-b10a065a915e | Amano-Sei/acmnomichi | ccpc2019qhd/i.cpp | /*************************************************************************
> File Name: i.cpp
> Author: <NAME>
> Mail: <EMAIL>
> Created Time: 2019年09月23日 星期一 17时06分29秒
************************************************************************/
#include <cstdio>
#include <algorithm>
#include <cstring>
... | ALGO | 0.999742 | 3.169283 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-12-07T03:13:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6cf9c23f6... |
042230e3-f0d1-45f3-8a68-1736ea30b664 | WLy2431217633/Test_C-CPP | linerlist/SequeceList.cpp | #include <stdio.h>
#include <stdlib.h>
// 定义线性表结构体
typedef struct {
int *data; // 存放元素的数组(动态分配内存)
int length; // 当前线性表长度
int capacity; // 当前分配的内存空间
} SeqList;
// 初始化线性表
void initList(SeqList *list) {
list->data = (int *)malloc(10 * sizeof(int)); // 初始分配空间为10个元素大小
list->length = 0; // 初始长度为0
... | ALGO | 0.999929 | 5.082151 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-03-14T09:47: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": "0028ccf9f51... |
3237cbbe-55cc-4c41-a2ef-1a046b9c2151 | Edith-3000/Algorithmic-Implementations | Graph/CSES Problem Set [ Graph Algorithms ]/Planets and Kingdoms.cpp | // Method 1 --->
// Problem: Planets and Kingdoms
// Contest: CSES - CSES Problem Set
// URL: https://cses.fi/problemset/task/1683
// Memory Limit: 512 MB
// Time Limit: 1000 ms
// Parsed on: 04-03-2021 10:47:04 IST (UTC+05:30)
// Author: <NAME>
// ********************************************************************
/... | ALGO | 0.999995 | 5.07448 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2020-07-24T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2afdacde... |
7996b6a5-9b14-49a6-904e-6fee54552774 | deious/Algorithm | AlgoRepo_1/프로그래머스_신규 아이디 추천.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(string new_id) {
string answer = "";
transform(new_id.cbegin(), new_id.cend(), new_id.begin(), ::tolower);
for (int i = 0; i < new_id.size();)
{
if (new_id[i] == '-' || new_id[i] == '_' || new_id[i] == '.' || (new_id[... | ALGO | 0.999594 | 5.137371 | {
"github_metadata": {
"branch": "master",
"commit_count": 1278,
"repo_created_at": "2020-08-21T14:45:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb9910c... |
4f1ffda7-9dee-4485-a7bc-e5e183f24e16 | Neha-Mangukiya/OOPs_Concept_Programs | 5.cpp | /*Define a class to represent a bank account. Include the following members:
Data Member:
-Name of the depositor
-Account Number
-Type of Account
-Balance amount in the account Member Functions -To assign values
-To deposited an amount
-To withdraw an amount after checking balance -To display name and balance
*/
#inclu... | TOOL | 0.960557 | 4.347579 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-07-02T08:48: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": "010c16ca13... |
38922a43-44eb-464f-b6d6-e32af758f3ca | JanekKwadrat/szkopul_itp | olimpiada_informatyczna/drogi_zmiennokierunkowe/dro_bru.cpp | /* <NAME>
XXIII Olimpiada Informatyczna, Etap II
Zadanie `Drogi zmiennokierunkowe (dro)' */
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 500'000 + 20;
int n, m;
vector<int> droga_out[N];
vector<int> droga_in[N];
bool visited_out[N] = {};
bool visited_in[N] = {};
queue<int> Queue;
vector<int... | ALGO | 0.999968 | 4.138379 | {
"github_metadata": {
"branch": "main",
"commit_count": 146,
"repo_created_at": "2022-02-06T06:39: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": "ab07faf18d... |
3cf2babd-8918-4241-9a5b-c19239801e05 | kjnh10/pcw | work/atcoder/abc/abc050/C/answers/031741_masu0912.cpp | #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <list>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <fstream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#inc... | ALGO | 0.99995 | 3.567049 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2018-05-23T15:03: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": "62f694059... |
f1c89a88-a922-4725-9bc6-c1860a6a566e | juruo-c/ACM | 22.08/22.8.27/22baidu/D.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <cmath>
#define ZYCMH
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 505, INF = 0x3f3f3f3f;
int n, m, k, q;
int a[N][N];
int s... | ALGO | 0.999955 | 3.843945 | {
"github_metadata": {
"branch": "main",
"commit_count": 197,
"repo_created_at": "2022-03-05T23:56:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30010d2ddd... |
0a958cff-9ee7-4afc-ba11-453ad02340a7 | whitel/algorithm | sort/bubble_sort.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> sortArray(vector<int>& nums) {
bubble_sort(nums);
return nums;
}
void bubble_sort(vector<int> &nums) {
for(int i = 0; i < nums.size(); i++) {
for(int j = 0; j < nums.size() - i - 1; j++) ... | ALGO | 0.999843 | 5.673205 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2022-03-19T11:44: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": "d0337ec02... |
f00e24fa-0885-43d9-90d3-383ba5ef93c7 | jiaaaaaaaqi/ACM_Code | HDU/6321/15165129_AC_1950ms_1384kB.cpp | #include<map>
#include<set>
#include<ctime>
#include<cmath>
#include<stack>
#include<queue>
#include<string>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lowbit(x) (x & (-x))
typedef unsigned long long int ull;
typedef long long int ll;
const doub... | ALGO | 0.999734 | 4.172777 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-11T16:04: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": "2e99d87af3... |
84a509be-dc78-4675-b760-cbc863cf2c38 | justiny7/competitive-programming | codeforces/div-3/virtual/780-1660/F2+/F2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// BIT {{{
template<class T> struct BIT {
int sz;
vector<T> bit;
void init(int _sz) {
sz = _sz;
bit.resize(sz, 0);
}
void upd(int i, T x) {
for (++i; i < sz; i += i & -i)
bit[i] += x;
}
... | ALGO | 0.999933 | 4.39754 | {
"github_metadata": {
"branch": "main",
"commit_count": 462,
"repo_created_at": "2020-11-07T20:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f91ed0e54... |
2910640d-bcee-4e56-9af7-4757b2b4049b | ee3190580/Bitmask_dp | forming_quiz_teams.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef long double ld;
#define endl "\n"
const ll INF = 1000000001;
ll binpow(ll a,ll b){
ll res=1;
while(b>0){
if(b&1)res=res*a;
a=a*a;
b>>=1;
}
return res;
}
int gcd(int a,int b){
i... | ALGO | 0.999869 | 4.287314 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-10-16T04:32:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1714fb3548f... |
3b1ab5e2-9668-4c5a-8c97-85ef5ab0b67b | dnfm257/coding | cpp/test2110/test2110.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, C;
vector<int> home;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N >> C;
int a;
for(int i = 0; i < N; i++){
cin >> a;
home.push_back(a);
}
... | ALGO | 0.999938 | 4.227891 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-05-08T14:39:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "001114f06ec... |
80dfa43c-dcb2-43ec-925f-1f264697ee6a | mgonzalezg9/Online-Judge | OMP/2019/G.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int num_casos;
cin >> num_casos;
for (int i = 0; i < num_casos; ++i)
{
int numProgramas;
cin >> numProgramas;
vector<string> secuencias;
vector<int> apariciones;
while (numProgramas > 0) {
string cad = "";
... | ALGO | 0.999677 | 3.870085 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-03-10T22:12:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ab1a69e0... |
ff5f7055-022c-4fbb-b416-436059d7c75d | gjs001/Algorithm | 나이트이동/나이트이동/소스.cpp | #include <cstdio>
#include <queue>
#include <cstring>
using namespace std;
typedef struct point {
int y;
int x;
int d;
}point;
int visit[301][301];
int n, t;
int dy[8] = { -2,-1,1,2,2,1,-1,-2 };
int dx[8] = { 1,2,2,1,-1,-2,-2,-1 };
queue<point> que;
int main() {
scanf("%d",&t);
while (t--) {
memset(visit,... | ALGO | 0.999752 | 3.494694 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-01-05T06:22: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": "9534ff6a7... |
3f775bf4-6d40-4a97-962d-ae338578162f | bitsai/book-exercises | Accelerated C++/chapter13/main_core.cc | #include <algorithm>
#ifndef __GNUC__
#include <ios>
#endif
#include <iomanip>
#include <iostream>
#include <stdexcept>
#include <vector>
#include <string>
#include "Core.h"
using std::cout; using std::cin;
using std::endl; using std::domain_error;
using std::setprecision; using std::setw;
usi... | TOOL | 0.919029 | 5.41751 | {
"github_metadata": {
"branch": "master",
"commit_count": 224,
"repo_created_at": "2010-08-24T01:45:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 431,
"forks": 265,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f855... |
794a7a70-9cc5-43a0-8ab2-cda0064cbf5a | mattiafucili/computer-graphics | Consegna/Lab6/Progetti/BumpMapping/BumpMapping/bumptex.cpp | #include <math.h>
#include "../common/common.h"
#define N 256
#define a 0.1
#define b 50.0
GLfloat normals[N][N][3];
GLfloat lightPos[4] = {0.0, 10.0, 0.0, 1.0};
GLuint program = 0;
GLuint texHandle;
GLuint texMapLocation;
GLint tangentParam;
const GLfloat tangent[3] = {1.0, 0.0, 0.0};
static void init() {
con... | ALGO | 0.988435 | 3.99678 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-10-09T09:50:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83d7a0d64c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.