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 |
|---|---|---|---|---|---|---|---|
1419ea72-b81b-41f5-b7ca-2c09d01d2e02 | param-sahai/Competitive-Programming | Code Jam/ChainReactionnew.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll b1[100009], b2[100009], b3[100009], b4[100009];
vector<int> C2[100009];
queue<int> V;
void find()
{
ll A1, A2, A3, A4, A5 = 0; // A1: N
cin >> A1;
for (int i = 0; i <= A1; i++)
{
b1[i] = b2[i] = b3[i] = b4[i] = 0;
C2... | ALGO | 0.999942 | 3.494843 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2022-05-09T05:11:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6fb0fb93... |
9984db66-0b96-4fbb-9ea0-d7974ee2f764 | karan221/cp | KICKSTART21C/Smaller_Strings.cpp | #include <bits/stdc++.h>
#define int int64_t
using namespace std;
const int mod = 1e9+7;
int modexp(int a, int n){
int p = 1;
while(n)
{
if(n & 1) p = p * a % mod;
a = a * a % mod;
n >>= 1;
}
return p;
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
... | ALGO | 0.999884 | 4.373463 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-03-27T14:54: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": "7400b8ec182... |
003e300c-3226-491d-800d-93bacef5c8c3 | MVARUNREDDY8203/LEETCODE_- | 554-brick-wall/brick-wall.cpp | class Solution {
public:
int leastBricks(vector<vector<int>>& wall) {
unordered_map<int, int> edge_freq;
int max_freq = 0;
for (int row = 0; row < wall.size(); row++) {
int edge_pos = 0;
for (int brick_no = 0; brick_no < wall[row].size() - 1; brick_no++) {
... | ALGO | 0.999964 | 6.014047 | {
"github_metadata": {
"branch": "main",
"commit_count": 3042,
"repo_created_at": "2023-07-05T16:07: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": "4aa470b97... |
5b1a4a31-6431-4a76-bd7a-357f78917396 | CSUwangj/LeetCode | 1140.stone-game-ii.3.cpp | /*
* @lc app=leetcode id=1140 lang=cpp
*
* [1140] Stone Game II
*/
// @lc code=start
auto speedup = [](){
cin.tie(nullptr);
cout.tie(nullptr);
ios::sync_with_stdio(false);
return 0;
}();
int dp[101][32];
class Solution {
int dfs(const vector<int> &prefix, int pos, int m, int result = INT_MIN) {
if(... | ALGO | 0.999901 | 5.351151 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-10-10T01:43: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": "44c172908... |
91e87a97-d4f4-470c-90e1-a37d0a856f01 | WANDEX/algorithms | tests/units/search/wndxc_binary_search.t.cc | #include <wndxc/search/wndxc_binary_search.h>
#include <gtest/gtest.h>
#include <stddef.h> // size_t
TEST(wndxc_binary_search, ZeroSizeArrayDEATH)
{
const int array[1] = {1};
ASSERT_DEATH(wndxc_binary_search(NULL, 0, 0), "sorted_array"); // assert NULL pointer
// Zero size arrays are an exte... | TEST | 0.945567 | 7.430317 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2022-08-19T13:09:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5a7055f... |
bfb1c05f-f407-47d3-b32b-3bd491826233 | llukito/leetCode | 0073-set-matrix-zeroes/0073-set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
if(matrix.size()<2){
if(find(matrix[0].begin(), matrix[0].end(), 0) != matrix[0].end()){
for(int i=0; i<matrix[0].size(); i++){
matrix[0][i] = 0;
}
}
} e... | ALGO | 0.999359 | 6.306335 | {
"github_metadata": {
"branch": "main",
"commit_count": 1043,
"repo_created_at": "2025-03-24T12:15: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": "841e5b061... |
eeb73ce3-eccf-4381-9436-3c62dee3b4ac | narim08/PS | ๋ฐฑ์ค/Silver/1018.โ
์ฒด์คํโ
๋ค์โ
์น ํ๊ธฐ/์ฒด์คํโ
๋ค์โ
์น ํ๊ธฐ.cc | #include <iostream>
#include<string>
#include<algorithm> //min ํจ์
using namespace std;
//๋๊ฐ์ง ๊ฒฝ์ฐ์ ์ฌ๋ฐ๋ฅธ ์ฒด์คํ ์ค์
string WB[8];
string BW[8];
void setBoard() {
for (int i = 0; i < 8; i++) {
if (i % 2 == 0) {
WB[i] = "WBWBWBWB";
BW[i] = "BWBWBWBW";
}
else {
WB[i] = "BWBWBWBW";
BW[i] = "WBWBWBWB";
}
}
}
... | ALGO | 0.99978 | 4.368604 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-01-31T06:33: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": "25beebfcdb... |
26642503-02e6-4762-9b73-a16911ff9f60 | Rudrakaniya/Behavioral_Java | os/threadReturn.cpp | //jatt_james_bond
//break_the_bond
#include <bits/stdc++.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <semaphore.h>
using namespace std;
typedef struct thread_data {
int result;
} thread_data;
struct marks{
//Maeks out of 100
int english;
int maths;
int dataStructure;
... | ALGO | 0.99593 | 4.006576 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-03-09T04:52:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12b1f27c5... |
65008d8c-e751-41db-8cf3-73d767ca109b | mvishiu11/grep | src/Matcher.cpp | #include "Grep/Matcher.hpp"
#include "Grep/Utils.hpp"
#include <iostream>
#include <stdexcept>
/**
* @brief Matches a pattern at a specific position within the input string.
*/
std::pair<std::string, bool> match_pattern_at_position(const std::string& input_line, const std::string& pattern, size_t input_pos) {
si... | TOOL | 0.96096 | 7.286677 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-08-14T08:04: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": "e88fd228e02... |
936df0ec-0e73-4300-8ab0-9b1779827942 | kl28978113/code | bc55b1.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
using namespace std;
#define REP(i, a, b) for (int i = (a), _end_ = (b); i < _end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x fi... | ALGO | 0.999969 | 3.797396 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-05-01T10:23: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": "f0ee484cd7... |
b0f1b6a1-6909-4d81-ac84-d16a722ffc11 | ishandutta2007/codeforces-g | gabrielwu/normal/1684/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define f first
#define s second
#define rand(i, j) uniform_int_distribution<ll>((ll)(i), (ll)(j))(rng)
mt19937 rng(std::chrono::steady_clock::now().time_since... | ALGO | 0.999926 | 4.33743 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "9387383debad... |
92302aa0-052f-4f51-9efc-630a6a23db23 | ywen19/AINote | algorithm/ไน ้ข3-3/ๅฅถ็ๅ่/Main.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2000;
// dp[l][r][j]่กจ็คบๅๅฎ[l, r]่ๅดๅ
็้่ๆถ็ๆๅฐ็ญๆก,jๅชๆ0/1ไธค็งๅๅผ,่กจ็คบๅฅถ็ๅๅฎๆๅไธๆฃต่ๅๅจ้่lๆrไธ
int dp[N+2][N+2][2];
// ๆฌๅฝๆฐๆฑ่งฃ็ญๆก๏ผๆๅคฑ็ๆๅฐๅฃๆๅ๏ผ
// n๏ผ้่ๆฃตๆฐ
// k๏ผๅฅถ็็ๅๅงๅๆ
// x๏ผๆ่ฟฐๅบๅ x๏ผ่ฟ้้่ฆๆณจๆ็ๆฏ๏ผ็ฑไบ x ็ไธๆ ไป 1 ๅผๅง๏ผๅ ๆญค x[0] ็ๅผไธบ -1๏ผไฝ ๅฏไปฅๅฟฝ็ฅๅฎ็ๅผ๏ผๅช้็ฅ้ๆไปฌไปไธๆ 1 ๅผๅงๅญๆพๆๆไฟกๆฏๅณๅฏ๏ผ๏ผๆไนๅ้ข็ฎๆ่ฟฐ
// ่ฟๅๅผ๏ผๆๅคฑ็ๆๅฐๅฃๆๅ
int getAns... | ALGO | 0.999811 | 3.962914 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-06-12T09:48:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c472cba5d9e... |
99fc1ac5-2a90-46f3-bf5b-abb92fda70a8 | TURIING/learn_opengl | chapter3-5/main.cpp | //
// Created by TURIING on 2023/11/25.
//
#include <vector>
#include "parallel_light/ParallelLight.h"
#include "point_light/PointLight.h"
#include "spot_light/SpotLight.h"
#include "spot_light_soft/SpotLightSoft.h"
int main() {
std::vector<float> vertices = {
// positions // normals ... | TOOL | 0.922281 | 4.193848 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-10-14T14:41:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "684ca4682... |
05014c54-ed75-498e-a43e-980f60e2e73b | RidanWeb/Data-Structure-and-Algorithm | MAX.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int q; cin >> q;
long long int n;
vector<long long int> nums;
int freq[1000005] = {0};
while(q--){
long long int x; cin >> x;
if(x == 2){
if(nums.em... | ALGO | 0.999858 | 4.213592 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-02-19T06:56: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": "9fdaf1e2789... |
3cdfa281-4bc8-49a2-a159-1ad87dc7f2e4 | Atharv-k-4898/DSA-CPP-PVT | 17.BackTracking/01Merge_sort.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <string>
#include <map>
#include <set>
#include <limits.h>
using namespace std;
// Question :Merge Sort Algorithms
// // What is actually merging
// leftwala part | rightwala part
// sort ... | ALGO | 0.999989 | 6.053666 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-07-08T17:00: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": "d74b4ab096f... |
26838a6f-a15c-4d0e-bbfa-ca728bff6694 | btk15049/home | pro/codeforces/edu/42/B.hpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#ifdef BTK
#define DEBUG if(1)
#else
#define CIN_ONLY if(1)
struct cww {cww() {CIN_ONLY{ios::sync_with_stdio(false); cin.tie(0);}}
}star;
#define DEBUG if(0)
#endif
#define ALL(v) (v).begin(),(v).end()
#define REC(ret, ...) std::function<ret (__VA_AR... | ALGO | 0.99983 | 3.258561 | {
"github_metadata": {
"branch": "master",
"commit_count": 309,
"repo_created_at": "2017-08-19T17:48:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "5e4aa6f9... |
2ec374eb-4263-4c65-a943-ea129b95a73d | mcvlab/leetcode | src/leetcode/cpp/q1437.cpp | /*
#้ข่ฏๅท้ข# ็ฌฌ0114ๆ
#Leetcode# Q1437 ๆฃๆฅๆฏๅฆๆๆ็1้ฝๆฏ่ณๅฐ้ฟๅบฆไธบK็ๅฐๆน็่ท็ฆป
้พๅบฆ๏ผไธญ
็ปๅบไธไธช0ๅ1s็ๆฐ็ปnumsๅไธไธชๆดๆฐk๏ผๅฆๆๆๆ็1้ฝ่ณๅฐ็ธ่ทkไฝ๏ผๅ่ฟๅTrue๏ผๅฆๅ่ฟๅFalseใ
็บฆๆๆกไปถ๏ผ
1 <= nums.length <= 10^5
0 <= k <= nums.length
nums[i] ๆฏ 0 ๆ่
1
็คบไพ1:
Input: nums = [1,0,0,0,1,0,0,1], k = 2
Output: true
Explanation: Each of the 1s are at least 2 places away from each other.
็คบไพ... | ALGO | 0.999869 | 6.143689 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2019-12-13T06:56:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed6649e93... |
c1ee584a-e071-491f-8070-e4396f1a6d0d | YunDid/AlgorithmForOffer | 66-ๅ ๆณ่ฟ็ฎ/Plus.cpp |
#include<iostream>
#include<vector>
#include<deque>
#include<math.h>
#include<algorithm>
#include<functional>
#include<list>
#include<string>
using namespace std;
namespace T66 {
#pragma warning(disable:4996);
//ๅฝๆฐๅๅๅฃฐๆ
void test();
void test1();
void test2();
void test3();
void test4();
bool isExcption = f... | ALGO | 0.999947 | 3.98904 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-30T05:15: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": "599653a84d... |
9bbdefba-7855-4e1a-99b5-12158da8f0af | sjm150/ps | baekjoon/11657/solution.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
const ll inf = 1e18;
const ll thr = inf / 2;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int n, m; cin >> n >> m;
vector<vector<pi>> edges(n + 1);
while (m--) {
int a, b, c; cin >> a >> b ... | ALGO | 0.999988 | 4.119533 | {
"github_metadata": {
"branch": "main",
"commit_count": 800,
"repo_created_at": "2023-02-14T08:02:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5617db1aba... |
1253ab01-58fb-4a39-b0bd-1ce1091510d3 | BillYang2016/Codes | bsoj5448-gift.cpp | #include<bits/stdc++.h>
using namespace std;
namespace FastIO {
const int L=1<<15;
char buffer[L],*S,*T;
/*inline char getchar() {
if(S==T) {T=(S=buffer)+fread(buffer,1,L,stdin);if(S==T)return EOF;}
return *S++;
}*/
inline int Get_Int() {
int num=0,bj=1;
char x=getchar();
while(!isdigit(x)) {if(x=='-')... | ALGO | 0.999956 | 3.551062 | {
"github_metadata": {
"branch": "master",
"commit_count": 273,
"repo_created_at": "2018-02-27T10:46:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c46925ba... |
22e9e682-320e-4746-9a46-ce801e0324dc | mslxl/cp-solution | coduck/็ปๅๆฐ็ๆซๅไฝ.cpp | #include<bits/stdc++.h>
const int maxsize = 3e4 + 17;
const int maxn = 20 + 17;
int a[maxsize], b[maxn];
int n, r;
void solve_factor(int n){
for(int m = 2; m * m <= n; m++){
while(n % m == 0 && n != 0){
n /= m;
a[m]++;
}
}
a[n]++;
}
void reduce(int n){
for(int m = 2; m <= n; m++){
w... | ALGO | 0.99991 | 3.599633 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2018-07-02T11:54:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "085a6897... |
f89ccbd5-56b8-4027-b0f0-641d05f2df3d | jugshaurya/recursion-CN | alternate_partionFun_quickSort.cpp | int partitionArray(int input[], int start, int end) {
int pivot = input[start];
// Count elements smaller than pivot and swap
int count = 0;
for(int i = start+1; i <= end; i++) {
if(input[i] <= pivot) {
count++;
}
}
int pivotIndex = start + count;
int temp = input[start];
input[sta... | ALGO | 0.999978 | 5.380208 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-06-03T10:46:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "609bc77be... |
2ab308ce-b82e-4e47-9443-5aaeef18cce6 | JAndronis/advent-of-code-2023 | day_1_trebuchet/trebuchet.cpp | //
// Created by <NAME> on 2023-12-25.
//
#include "trebuchet.h"
int main() {
// Part 1
std::ifstream input_file;
input_file.open(trebuchet::input);
if (!input_file.is_open()) {
std::cout << "Failed to open " << trebuchet::input << std::endl;
} else {
long sum = 0;
for (std... | ALGO | 0.907562 | 4.749711 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-12-27T11:37: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": "fc85f6a69411... |
5b939759-b28e-45a6-8110-2f8b8bb1f89d | SiddhantAttavar/Competitive-Programming | CSES Problem Set/Graph Algorithms/Planets_and_Kingdoms.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename T> inline void input(T& inVar) {cin >> inVar;}
template<typename T, typename... S> inline void input(T& inVar, S&... args) {cin >> inVar; input(args ...);}
template<typename T> inline void print(T outVar) {cout << outVar << '\n';}
template<typename T, type... | ALGO | 0.999929 | 4.801817 | {
"github_metadata": {
"branch": "main",
"commit_count": 607,
"repo_created_at": "2021-09-16T08:14:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "badea2cd5... |
bf545dcd-d984-47f8-981a-29b37d63342d | dnanexus-archive/parliament2 | resources/home/dnanexus/root/include/vdt/inv.h | /*
* inv.h
* An experiment: implement division with the square fo the approximate
* inverse square root.
* In other words one transforms a shift, multiplications and sums into a
* sqrt.
*
* Created on: Jun 24, 2012
* Author: <NAME>, <NAME>, <NAME>
*
* VDT is free software: you can redistribute it an... | ALGO | 0.99637 | 5.471585 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2018-05-24T03:58:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 102,
"forks": 39,
"issues": 25,
"pull_requests": 5
},
"file_meta": {
"content_id": "3e7ac1... |
a32970ca-b05d-4c9f-b265-726dbc1b1b75 | mdarikrayhan/Competitive-Programming | codeforces/899/B.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
// List of days in each month in a normal year
vector<int> normal_year = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
// List of days in each month in a leap year
vector<int> leap_year = {31, 29, 31, 30, 31, 30, 31, 31, 3... | ALGO | 0.999994 | 4.817607 | {
"github_metadata": {
"branch": "master",
"commit_count": 8052,
"repo_created_at": "2022-05-15T11:22:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9c73d... |
199ab99e-ca29-4be0-8af4-c370de135dd9 | kayw/CareerInterview | schoolboy/sort_stub.cc | //clang++ -std=c++11 -g
#include "heapsort.hpp"
#include "merge_quick_sort.hpp"
#include "O_n2_sort.hpp"
#include <stdio.h>
#include <functional>
#include <random>
int main(int /*argc*/, char */*argv*/[]) {
int arr[9] = {8,4,6,3, 12, 17,14, 1, 25};
heapSort<int, std::less<int>, 9>(arr);
for (int i = 0; i < 9; ++... | ALGO | 0.998618 | 4.874203 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2014-02-20T14:55:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f87c675b7... |
773b51f4-7f2f-4cb3-8f7c-3313d0be8844 | kipr/opencv | modules/legacy/src/bgfg_gaussmix.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.968384 | 6.283004 | {
"github_metadata": {
"branch": "master",
"commit_count": 7094,
"repo_created_at": "2013-01-27T01:06:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 152,
"forks": 340,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "c408... |
d3353999-5373-41e8-a7ec-3931af229fc8 | chi-tech/chi-tech | modules/LinearBoltzmannSolvers/A_LBSSolver/Acceleration/diffusion_mip_02a_assembleAand_b.cc | #include "diffusion_mip.h"
#include "acceleration.h"
#include "mesh/MeshContinuum/chi_meshcontinuum.h"
#include "math/SpatialDiscretization/SpatialDiscretization.h"
#include "math/SpatialDiscretization/FiniteElement/QuadraturePointData.h"
#include "physics/PhysicsMaterial/MultiGroupXS/multigroup_xs.h"
#include "chi... | ALGO | 0.998281 | 4.10844 | {
"github_metadata": {
"branch": "development",
"commit_count": 2280,
"repo_created_at": "2019-08-23T18:33:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 37,
"forks": 48,
"issues": 32,
"pull_requests": 1
},
"file_meta": {
"content_id": "... |
7479fe91-526e-4514-8795-52e0a73cdea7 | JustaHollowDot/CLionProjects | elevraad/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
long long int stemmer, kandidater, mineStemmer, rest = 0, diff = 0;
cin >> stemmer >> kandidater >> mineStemmer;
const int constMineStemmer = mineStemmer;
vector<int> deltakereStemmer(kandidater - 1, 0);
... | ALGO | 0.999991 | 3.114456 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-06-29T20:38: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": "6b1779703... |
2ebbb16b-0155-44d2-bc74-94e3023b40ba | AyushRawat1718/Binary-Tree | Binary Tree Questions/diameterOfTree.c++ | // Question - You will be given the root node of the binary tree, return the diamater of the tree.
// Diameter of the tree is the number of nodes on the longest path between any two nodes
#include <bits/stdc++.h>
using namespace std;
//---------------------------------------------------Required Code------------------... | ALGO | 0.999857 | 4.405995 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-01-04T15:46:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f344cee0a81... |
a36e9c1f-f378-4b80-86b4-751779e6a143 | raincross7/code-similarity | codes/train_code/problem214/problem214_423.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <stdio.h>
typedef long long ll;
using namespace std;
bool isPrime(ll n){
if(n < 2){
return 0;
}
if(n%2 == 0){
return n==2;
}
for(ll i=3;i*i<=n;i++){
if(n%i == 0) return 0;
}
return 1;
}
string toBinary(ll x){
... | ALGO | 0.999954 | 3.850483 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fd45be15d7a... |
1df2d0ee-f34c-46aa-9897-54bb374eff13 | mroggy08/Code-chill-everyday | src1/bochatchoi.cpp | #include <bits/stdc++.h>
#define ll long long
#define ii pair<int,int>
#define xi first
#define hi second
#define vi vector<int>
#define vii vector<ii>
#define pb push_back
#define f1(i,n,m) for (int i=n; i<=m; i++)
#define bit(i,x) ((x>>i)&1)
#define bp __builtin_popcount
using namespace std;
const int N = 1e6+3;
int ... | ALGO | 0.999907 | 3.115307 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-15T10:12: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": "f39e6b503d... |
8c3541d1-b1b2-45f1-a3f1-b077b36baec0 | dnatale1/Number-Crunching | matrixMult6.cpp |
/* matrixMult6.cpp
*
* Author: <NAME>
*
* May 2024
*
* I used Intel compiler 2021.5.0.
*
* Compiled with:
* icpc -O3 matrixMult6.cpp -o proj6
* ./proj6
*
* This program requires 176GB RAM to run.
*
* The last entry in the MATRIXRESULT file is: 47548574628160599738023936.
*
... | ALGO | 0.996439 | 3.671643 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2022-09-20T20:47: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": "476067403e... |
1fe7a440-0a9e-4771-9c4c-3808698482ee | SayemImran/DSA-practise | module6_5/find_duplicate_in_linked_list.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
void insert_at_tail(Node* &head, Node* &tail, int value)
{
Node *newnode = new Node(value);
if (head == NULL)
{
hea... | ALGO | 0.999822 | 4.074255 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-17T01:17:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a36d035b4d... |
49b22f24-8775-4959-b4ce-48ecd27927ef | ishandutta2007/codeforces-g | gyojunyoun/normal/1158/C.cpp | #include <bits/stdc++.h>
#define rf(x) (x)=0;while(*p<48)p++;while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);
//#define rf(x) (x)=0;while(*p<48)im=*p=='-';while(47<*p)(x)=((x)<<3)+((x)<<1)+(*p++&15);if(im)(x)=-(x);
#define pb push_back
#define eb emplace_back
#define sz(V) ((int)(V).size())
#define allv(V) ((V).begin()),((... | ALGO | 0.999946 | 3.958478 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "06c560e53377... |
b46fbecf-be2f-4f1d-add2-54c11707d676 | cedarz/ltcode | 6.cpp | //ZigZag Conversion
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string convert(string s, int nrs) {
int len = s.size();
if(nrs == 1 || nrs >= len) return s;
int stp = (nrs << 1) - 2;
string t;
for(int i = 0; i < nrs; ++i) {
... | ALGO | 0.999997 | 4.664067 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2016-06-17T07:38: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": "bbc2f96b... |
d8d01573-299c-46b7-96b0-06429af4415d | nahid597/LeetCode-Solution | numberofonecheck.cpp | #include<iostream>
using namespace std;
bool checkNum(int arr[], int n) {
bool st = false;
for(int i = 0; i < n; i++) {
if (arr[i] > 2)
{
return false;
}
}
for (int i = 0; i < n; i++)
{
if (arr[i] == 2)
{
st = true;
break;
... | ALGO | 0.999475 | 3.800862 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-01-17T10:53:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35de74349048... |
7bee6d65-264f-4bec-9abb-4f94e8e562c7 | Munawertaj/Codeforces | C_Social_Distance.cpp | /*
Date: 17 December 2022
Problem Link: https://codeforces.com/problemset/problem/1367/C
Author: <NAME>
CSE, Rajshahi University
*/
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pa... | ALGO | 0.999954 | 4.355006 | {
"github_metadata": {
"branch": "main",
"commit_count": 438,
"repo_created_at": "2022-04-21T10:06:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45a9be4567... |
03bfbb67-9b77-4c89-9919-ee865e03f3bf | lkp0907/Algorithm | Algorithm/maze_dfs.cpp | //
// maze.cpp
// Algorithm
//
// Created by <NAME> on 2015. 1. 21..
// Copyright (c) 2015๋
com.devsfolder.Algorithm. All rights reserved.
//
// maze by DFS
// DFS ๋ก ๋ฌธ์ ํ๊ธฐ
#include <stdio.h>
#define kMAX_LENGTH 21
int X, Y;
int Min = 999;
char MAP[kMAX_LENGTH][kMAX_LENGTH];
int VISIT[kMAX_LENGTH][kMAX_LENGTH];
i... | ALGO | 0.99992 | 3.72526 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2015-01-10T13:04: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": "fd6a9f823... |
457a374a-19fd-453f-8a5f-fb959938a7bf | OmarAhmedElwekeil/ConvEvolution_Computer_Architecture | OpenMP.h | #ifndef OpenMP_H
#define OpenMP_H
#include <omp.h>
#include <iostream>
#include <vector>
using namespace std;
typedef vector<vector<vector<float>>> Volume;
Volume conv3dUnrolledOpenMP(const Volume& input, const Volume& kernel) {
int num;
cout << "Enter the number of threads tou wanna use: " << endl;
cin... | ALGO | 0.945076 | 5.02064 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-12T13:21:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd40f19682e3... |
7ad8168b-8e5b-4b06-8395-67e902dfe90c | LordK23/C-plus-plus | main.cpp | #include <iostream>
using namespace std;
int reading_from_input ()
{
int totall;
again :
cout << " enter the number form 1 to 1000 : " ;
cin >> totall;
if (totall>=1 && totall<=1000)
{
cout << "drink volume in liters : " << totall << " Liters " << end... | TOOL | 0.98072 | 3.28284 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-12-06T14:14: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": "24f0483c5fab... |
5faf0c24-638f-47a5-a9d8-340a222b0965 | ifanzilka/FT_STL | STL/iterator/iter_distance.hpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* iter_distance.hpp :+: :+: :+: ... | ALGO | 0.934552 | 6.72443 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2022-02-01T22:18:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "055e8f4d1... |
deb3152b-b5d9-459c-a13f-7dbe9f6b1c94 | AvaLovelace1/competitive-programming | solutions/ccc/cco07p1.cpp | /*
Solution to CCO '07 P1 - Cows by <NAME>
Key concepts: geometry, convex hull, shoelace formula
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
const int INF = 0x3F3F3F3F;
int N;
pii arr[10005];
stack<pii> h1, h2;
vector<pii> hu... | ALGO | 0.999922 | 4.560728 | {
"github_metadata": {
"branch": "master",
"commit_count": 782,
"repo_created_at": "2018-03-04T18:04:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "90a3d03c... |
8ee4d264-fc34-4b2b-be20-aa50db5ba444 | AthulJoseph27/Codeforces | 800/1512.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define all(v) v.begin(), v.end()
void __print(int x)
{
cerr << x;
}
void __print(long x) { cerr << x; }
void __print... | ALGO | 0.99979 | 4.078246 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2021-04-03T18:12: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": "6b54014eb0... |
f499fec0-ab7e-41ec-b07e-2883abdeba9e | latimercaleb/courseWork | csc1500/Lab 1/Latimer CalebLab1/Source1.cpp | #include<iostream>
#include<fstream>
using namespace std;
int main()
{
ofstream prog1_output;
prog1_output.open("prog1_output.txt");
int ans;
cout << "Type a number 1-5 for truth tables \n" << "1: Conjunction \n" << "2: Disjunction \n" << "3: Conditional \n" << "4: Biconditional \n"
<< "5. XOR \n";
cin >> ans;
... | ALGO | 0.989226 | 3.756064 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2016-08-22T04:03:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1c758b85... |
f40ed6ef-73e1-4df2-94b3-eac4861a9b2a | james61124/Data-Structures-and-Object-oriented-Programming-2021-spring-NYCU | hw3/hw3_spec/OOP_HW03_202102_Template_NET2010/00_StudentWork/00_SimpleInteractiveSystem/myBasicTools.cpp | #include <iostream>
#include "myBasicTools.h"
/*
Generate a random numbe
between x0 and x1 (inclusive).
*/
double getRandDouble(double x0, double x1)
{
int r = rand()%RAND_MAX;
double f = r/(double)RAND_MAX;
return x0 + f*(x1-x0);
}
double computePointLineSegmentDistance2( const vector3 &p, const vector3... | ALGO | 0.997622 | 4.692075 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-06T19:05:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "130400c1e85e... |
d6e1e088-045e-4593-89ef-65c430afc94a | yuukidach/OnlineJudge | LeetCode/Q733_FloodFill.cpp | class Solution {
public:
const int dr[4] = {1, 0, -1, 0};
const int dc[4] = {0, -1, 0, 1};
vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int newColor) {
queue<pair<int, int>> q;
q.emplace(sr, sc);
int rlen = image.size();
if (rlen == 0) return ima... | ALGO | 0.997014 | 6.554048 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2020-04-04T15:08: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": "63d7c5dd... |
814616e1-8fdb-4542-b123-e412799c16cf | shahbazk/IncDFS-Experimental | include/IncSDFS.h | /*******************************************************************************
* include/IncSDFS.h
* Implementation of the SDFS algorithm.
* Opt = 0 : SDFS
* Opt = 2 : SDFS2
* Opt = 4 : SDFS3
*
* Part of Project: Incremental-DFS-Experimental:
* https://github.com/shahbazk/IncDFS-Experiment... | ALGO | 0.998708 | 5.497166 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-30T09:45: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": "0ba968c935... |
6b2c340b-dd00-454a-ba87-db495af8a550 | ikuo-suyama/competitive-programming | hitachi2020/hitachi2020_b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE \
ifstream in("hitachi2020/hitachi2020_b.txt"); \
cin.rdbuf(in.rdbuf());
#else
#define INPUT_FILE
#endif
#d... | ALGO | 0.999995 | 4.982372 | {
"github_metadata": {
"branch": "master",
"commit_count": 515,
"repo_created_at": "2020-01-21T13:58: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": "aaa8904e... |
980f7b44-1714-4483-81ad-3e068d9f06cf | pravinargade18/LP1-Assignments | FCFS.cpp | #include<iostream>
using namespace std;
void findWaitingTime(int n, int bt[],int wt[], int at[]){
int service_time = at[0];
wt[0] = 0;
for (int i = 1; i < n ; i++){
service_time += bt[i-1];
wt[i] = service_time - at[i];
if(wt[i]<0){
wt[i]=0;
}
}
}
void findTurnAroundTime(int n, int bt[],int w... | ALGO | 0.999595 | 4.169621 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-11-19T06:43:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0376eb91f0a... |
4e4b8c19-bad9-485a-8ca6-6fdfe3c26a22 | explorer02/AI-Algorithms | ab/1_puzzle.cpp | #include <bits/stdc++.h>
using namespace std;
int previous=-1;
bool check(int start[3][3], int end[3][3]){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
if(start[i][j]!=end[i][j]){
return false;
}
}
}
return true;
}
int calculate(int start[3][3], ... | ALGO | 0.999964 | 4.783773 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2020-10-06T03:07:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "116a1387131... |
ed36b656-282a-4531-92ad-0dc491b97031 | quynh410/ss7-java | ss7/Bai1.cpp | #include <stdio.h>
#define MAX 100
typedef struct {
int data[MAX];
int front;
int rear;
} Queue;
void initializeQueue(Queue *q) {
q->front = -1;
q->rear = -1;
}
int isFull(Queue *q) {
return q->rear == MAX - 1;
}
int isEmpty(Queue *q) {
return q->front == -1 || q->front > q->rear;
}
voi... | ALGO | 0.998341 | 4.417073 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-12T02:29: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": "85bc03c15663... |
2d48fdaf-4507-4155-befb-cb9ffe73794f | Seann0425/LeetCode | finished/773. Sliding Puzzle.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
TreeNode *righ... | ALGO | 0.99994 | 5.230744 | {
"github_metadata": {
"branch": "main",
"commit_count": 659,
"repo_created_at": "2024-05-02T09:26: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": "58546fc9f9... |
72cca4c2-91a6-4661-b065-ddadf31cabd8 | myjupyter/AdvCpp | hw_6/include/config/configurator.h | #ifndef CONFIG_CONFIGURATOR_H_
#define CONFIG_CONFIGURATOR_H_
#include <fstream>
#include <unordered_map>
#include <string>
#include <stdexcept>
#include <regex>
const std::regex regex_key_value("( )*(.+?)( )*=( )*(.+?)+( )*");
const std::regex regex_section("\\[(\\w)+\\]");
namespace Network::Config {
class Config... | CONFIG | 0.928946 | 7.094957 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2020-03-10T13:45: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": "a0528fe2b... |
de0f4623-91ef-471d-99ad-bb5224151a56 | metaflow/contests | uva/chapter_1/300.cc | #include<bits/stdc++.h>
using namespace std;
using vi = vector<int>; using vvi = vector<vi>;
using ii = pair<int,int>; using vii = vector<ii>;
using l = long long; using vl = vector<l>; using vvl = vector<vl>;
using ll = pair<l,l>; using vll = vector<ll>; using vvll = vector<vll>;
using lu = unsigned long long;
using ... | ALGO | 0.999898 | 3.942366 | {
"github_metadata": {
"branch": "master",
"commit_count": 415,
"repo_created_at": "2014-05-12T04:59:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70e780ea... |
3c52dbb4-1a86-4cc5-bd77-7d95ff4210d1 | royappa/contests | GCJ/c2011r1c.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999904 | 3.645176 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2024-12-29T21:37: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": "b08baa266db... |
a14f85ac-ac61-4201-ac48-cf63aa365c4c | kenkoooo/graph-sketch-fractality | src/box_cover/box_cover_test.cc | #include "box_cover.h"
#include "gtest/gtest.h"
using namespace agl;
using namespace agl::box_cover_internal;
using namespace std;
pair<vector<V>, vector<V>> inv_and_rank(const G &g) {
vector<V> rank(g.num_vertices());
vector<V> inv(g.num_vertices());
for (V i = 0; i < g.num_vertices(); ++i) inv[i] = i;
shuff... | TEST | 0.927641 | 6.382039 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-26T05:59:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f9d9331fa... |
e186ac19-67f9-4620-80f3-a21aa9662fd6 | rambabu-patidar/CPP-Programs | C++ Programs/Template in c++/template-declaring-member-function-outside-the-class-template.cpp | #include<iostream>
using namespace std;
#define n 5
// but what if we want to declare the member function outside the class
// this can be done by member function templates the program given below explain this
template<class T>
class vector {
T* v;
public:
vector() {
v = new T[n];
for(int... | ALGO | 0.998046 | 4.957505 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-04-02T12:51: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": "95cd2dca492... |
980e8cae-5088-440f-acb0-b2d585b4b5e4 | dhirajpatil2346/compitative | a20j/hungry_sequence.cpp | #include <bits/stdc++.h>
using namespace std;
void lr(vector<int> &v)
{
for (int i = 0; i < 4; i++)
{
int temp = v[i];
v[i] = v[i + 1];
v[i + 1] = temp;
}
}
int main()
{
int arr[5][5];
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
... | ALGO | 0.999993 | 3.923145 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-09-28T12:31: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": "b45178c97de... |
0e223c2b-c0da-4309-b6cf-6ce9705dbdc8 | Soumik-HasanSMK/Codeforces-Contest-2025 | Codeforces Round 1017 (Div. 4)/C_Brr_Brrr_Patapim.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define db double
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> v(2 * n + 1);
vector<int> vec(2 * n + 1);
for (int i = 1; i <= n; i++)
for (int j = 1; j <... | ALGO | 0.999907 | 3.561903 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-16T14:32:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc12d7fb517d... |
cc2ece1a-937f-4df0-800f-56c00280dea3 | MHRipon01/DSA | Data_structure/Tree/BinaryTree/Level_order_traversal/level_order_traversal.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
void level_order(Node *root)
{
queue<Node *> q;
q.push(root);
while (!q.empty()... | ALGO | 0.999915 | 4.438194 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-12-22T13:32: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": "740d0fe9de6... |
7b13452a-cd12-4f0b-a728-78a3eba1a81c | alexandraback/datacollection | solutions_5706278382862336_1/C++/aid/main.cpp | #include <fstream>
using namespace std;
const long long K = 1ll << 40;
const int P = 40;
long long gcd(long long a, long long b) {
return b? gcd(b, a % b) : a;
}
int main() {
ifstream in("input.txt");
ofstream out("output.txt");
int t;
in >> t;
for(int tt = 0; tt < t; tt++) {
long lo... | ALGO | 0.999488 | 3.913277 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a45d7e5f7... |
8743545f-cd75-4be0-ba5c-1369cd88afb0 | mathiashahner/pendulum | include/pendulums/double-pendulum.h | #ifndef DOUBLE_PENDULUM_H
#define DOUBLE_PENDULUM_H
#include <math.h>
#include <line.h>
#include <circle.h>
#include <vector>
#define GRAVITY 9.81
#define TIME_STEP 0.1
#define MAX_AMPLITUDE 90 * M_PI / 180.0
#define TH1 0
#define TH1P 1
#define TH2 2
#define TH2P 3
#define TH1PP 4
#define TH2PP 5
#define KE 6
#defi... | TOOL | 0.915918 | 5.665949 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-01-30T20:59: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": "87136ae54051... |
2bf52778-5958-4f09-9e0e-a48a26c1115a | haozzzzzzzz/osgEarthX | environment/build/osgearth-2.6/src/osgEarth/Pickers.cpp | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2014 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundat... | ALGO | 0.962834 | 6.257688 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2015-09-19T06:19:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 75,
"forks": 48,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "32194ce... |
8d92a395-9c35-4d15-9937-19946de67c8f | StephenGuanqi/leetcode | cpp/dfs/N-Queens.cpp | //
// Created by <NAME> on 1/2/18.
//
#include <vector>
#include <iostream>
using namespace std;
class Solution {
/**
* permutation. if n = 4:
* [2, 4, 1, 3]
* but not [1, 2, 3, 4] ---> diagnal arttack
*/
public:
vector<vector<string>> solveNQueens(int n) {
vector<vector<string>> result;
vector<int> co... | ALGO | 0.999651 | 5.451399 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-07-09T11:00: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": "3ab13cb68c... |
27e7fcf7-5762-4e5d-bba1-22f54212c824 | GyuhoLee/PS | BOJ/15000/15997_์น๋ถ์์ธก.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define FUP(i, a, b) for(int i = a; i <= b; i++)
#define FDOWN(i, a, b) for(int i = a; i >= b; i--)
#define MS(a, b) memset(a, b, sizeof(a))
#define ALL(v) v.begin(), v.end()
#define CIN(a) cin >> a;
#define CIN2(a, b) cin >> a >> b
#define CIN3(a, ... | ALGO | 0.999817 | 4.156844 | {
"github_metadata": {
"branch": "master",
"commit_count": 700,
"repo_created_at": "2019-05-26T15:16:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71b17cac... |
c13d8205-7f0e-4648-a00c-22cc8f226413 | ishandutta2007/codeforces-i | intothenight/normal/414/E.cpp | #include <bits/stdc++.h>
using namespace std;
template<class F>
struct y_combinator_result{
F f;
template<class T> explicit y_combinator_result(T &&f): f(forward<T>(f)){ }
template<class ...Args> decltype(auto) operator()(Args &&...args){ return f(ref(*this), forward<Args>(args)...); }
};
template<class F>
decltype... | ALGO | 0.999433 | 4.106244 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "f124994bcf0b... |
c89fe727-7ef3-4ff8-8029-49d68f3b26c7 | CGAL/cgal | Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h | // Copyright (c) 2013-2015 The University of Western Sydney, Australia.
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Authors: <NAME>, <NAME>
/*! \file Compute_cone_boundaries_2.h
*
* This he... | ALGO | 0.999722 | 6.692577 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
cb3df110-190a-4e3b-831d-bf74fd59ef03 | flameshimmer/leet2019.io | Leet2019/MaximalRectangle.cpp | #include "stdafx.h"
//Given a 2D binary matrix filled with 0's and 1's, find
//the largest rectangle containing only 1's and return its area.
//
//Example:
//
//Input:
//[
// ["1","0","1","0","0"],
// ["1","0","1","1","1"],
// ["1","1","1","1","1"],
// ["1","0","0","1","0"]
//]
//Output: 6
namespace Solution2019... | ALGO | 0.999912 | 6.101847 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2019-08-14T16:44:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ddf2454... |
96c7a42e-fa17-43fc-abde-fe62aca52963 | Vainres/Code | HK2/CTDL/1/1/1.cpp | #include <iostream>
#include<conio.h>
int f = 0,s,gt,bai6=0,bai9=0,xx;
using namespace std;
typedef struct tagNode
{
int info;
struct tagNode* pNext;
}Node;
typedef struct tagList
{
struct tagNode* pHead;
struct tagNode* pTail;
}List;
void CreateList(List& I)
{
I.pHead = NULL;
I.pTail = NULL;
}
Node* CreateNode(... | ALGO | 0.999255 | 3.178493 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-05-04T05: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": "32f73c7e6e... |
9a329135-1f1f-4922-beee-b5d9f808d84a | legolasse/Advent-of-Code | 2023/P18.cpp | typedef pair<PLL,PLL> QLL;
LL hexToInt(char c) {
if(c >= 'a' && c <= 'f')
return 10 + c-'a';
if(c >= 'A' && c <= 'F')
return 10 + c-'A';
return c-'0';
}
LL answer = 0;
//LL width, height;
string dirs = "RDLU";
set<LL> DX;
vector<QLL> vertical, horizontal;
char M[400][400];
int main() {
FORY(400) {
... | ALGO | 0.999121 | 4.071734 | {
"github_metadata": {
"branch": "master",
"commit_count": 974,
"repo_created_at": "2022-12-02T09:24: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": "a581865c... |
21a048ae-f3e8-4d34-9a68-8439f0a297b8 | yamate11/compprog | zAsa/y2024/0614/5/cans.cc | #include <bits/stdc++.h>
#include <cassert>
using namespace std;
using ll = long long int;
using u64 = unsigned long long;
using pll = pair<ll, ll>;
// #include <atcoder/all>
// using namespace atcoder;
#define REP(i, a, b) for (ll i = (a); i < (b); i++)
#define REPrev(i, a, b) for (ll i = (a); i >= (b); i--)
#define A... | ALGO | 0.999982 | 4.298678 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2021-03-11T06:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "874fb049b7... |
67436630-ff62-4fcc-abd1-87034b62bbe5 | illemonati/nifty-evil-hangman | main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <tuple>
#define blank "โ"
using namespace std;
unsigned int get_word_length() {
while (true) {
unsigned int temp = 0;
cout << "Please enter the desired word length: " << endl;
cin >> temp;
if (!(temp ... | TOOL | 0.950792 | 3.804435 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-09-04T02:22: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": "5844e4f829... |
5da82af3-5eb3-457b-b027-9cf058bd242d | mehemmedv/competitive_programming | IN2106 - Algorithms for Programming Contests/Week 2/E.cpp | #include <bits/stdc++.h>
#define MAX 100100
using namespace std;
typedef long long ll;
int val[MAX], w[MAX], par[MAX];
bool used[MAX];
int find(int x){
if(par[x] == x)
return x;
return par[x] = find(par[x]);
}
void join(int x, int y){
int fx = find(x), fy = find(y);
if(fx == fy)
retur... | ALGO | 0.999911 | 4.407669 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-06-06T14:16:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "130e30e70... |
9ac7e514-9c52-4d79-964c-26883a6ee9ae | peterpashkin/timeline-index | TimelineIndex.h | //
// Created by <NAME> on 04.12.23.
//
#include "EventList.h"
#include "VersionMap.h"
#include "TemporalTable.h"
#include "Tree.h"
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#ifndef TIMELINEINDEX_TIMELINEINDEX_H
#define TIMELINEINDEX_TIMELINEINDEX_H
typedef Tree<uint32_t, 16> checkpoint;... | TOOL | 0.970474 | 6.626472 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-03-21T19:53: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": "cfee74cc8ea... |
2e231e97-a99d-48b1-a7c3-a7bf1cc81d57 | tiny656/PAT | PAT (Basic Level) Practice ๏ผไธญๆ๏ผ/1050_่บๆ็ฉ้ต(25).cpp | #include <bits/stdc++.h>
using namespace std;
/*
่ฏปๅ
ฅๆฐๆฎ๏ผๆๅบ๏ผ้ๅwhileๅพช็ฏๆจกๆๆ่ฝฌ่ฟ่กๅกซๅ
*/
int main() {
vector<int> v;
int n;
cin >> n;
v.resize(n);
for (int i = 0; i < n; i++)
cin >> v[i];
sort(v.begin(), v.end(), greater<int>());
int row = 1, col = 1;
int minDiff = 10005;
for (int i =... | ALGO | 1 | 3.969113 | {
"github_metadata": {
"branch": "master",
"commit_count": 460,
"repo_created_at": "2012-11-27T13:40:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 272,
"forks": 71,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8661c... |
700945ac-0bd5-4372-92c7-027bc24bc17e | MirrorYuChen/ncnn_example | ncnn-20210525-full-source/src/layer/lstm.cpp | // Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy ... | DATA | 0.992307 | 6.898061 | {
"github_metadata": {
"branch": "master",
"commit_count": 167,
"repo_created_at": "2019-04-25T01:53:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 475,
"forks": 135,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "f0e1... |
8e87c2de-6be5-45fb-9c8f-a049bfa00048 | Pudv95/My_Space | Leetcode_and_GFG/Dynamic_Programming/Best_time_to_buy_and_sell_stocks-ii.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
class Array
{
public:
template <class T>
static void input(vector<T> &A, int n)
{
for (int i = 0; i < n; i++)
{
scanf("%d ", &A[i]);
}
}
template <class T>
static void print(vector<T> &A)
... | ALGO | 0.999506 | 5.727166 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-09-13T13:01: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": "9ba04d4898... |
cf20a018-469d-446a-8de5-4c764919fb7d | HOONSTREAM/C-BasicProgramming | Programming(C++)/STL/โ
์๊ณ ๋ฆฌ์ฆ/unique() ์๊ณ ๋ฆฌ์ฆ/unique() ์๊ณ ๋ฆฌ์ฆ/unique()์๊ณ ๋ฆฌ์ฆ.cpp | //unique() ์๊ณ ๋ฆฌ์ฆ : ์ธ์ ์์๋ฅผ ์ ์ผํ๊ฒ ๋ง๋ ๋ค. search_n() -> unique() ์๊ณ ๋ฆฌ์ฆ ํ์ฉ ๋ฐฉ๋ฒ๋ ์์.
// ์ ๋ ฌํ์ํ์์ ์ํํ๋ฉด ๋ชจ๋ ์์๋ฅผ ์ ์ผํ๊ฒ ๋ง๋ค ์ ์์ผ๋ฉฐ, ๋
ผ๋ฆฌ์ ์ผ๋ก๋ง ์ ๊ฑฐ ํจ. ์ค์ ๋ก ์ ๊ฑฐ๋์ง ์์.
// ์ฐ๋ ๊ธฐ๊ฐ์ ๋ค๋ก๋ชฐ์์ ์ฐ๋ ๊ธฐ๊ฐ ์ฒ๋ฆฌ๊ฐ ์ฉ์ดํจ. erase() ๋ฉค๋ฒํจ์๋ฅผ ํตํด์.
//๋์ ๋ฐฉ์์ ํ๋ฆฐํธ๋ฌผ์ ์ฐธ์กฐํ๋ค.
//while ๋ฌธ์ ๋ถ์ถฉ์กฑ ํ ๋๊น์ง ๋ฐ๋ณต ๋์ํ๋ค.๋ด๋ถ if๊ฐ false๋ฉด ๋ฐ๋ก while๋ฌธ์ผ๋ก ๋๋์๊ฐ๋ค. ์ฐธ์ด๋ฉด ์งํ. while ๋ฌธ์ด ์ข
๋ฃ๋๋ฉด ์ค์ฝํ ๋ฐ ๋ฌธ์ฅ์ ์คํํ๋ค.
/*unique ์... | ALGO | 0.99603 | 4.393212 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-08T13:55: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": "eecba36dd2c6... |
31bd4bba-5627-4bf7-8433-38dbb112a4d1 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/14/13/12.cpp | #include <cstdio>
int a[1010];
int main(void) {
freopen("in", "r", stdin);
freopen("out", "w", stdout);
FILE *fin = fopen("log", "w");
int kase; scanf("%d", &kase); for (int _ = 1; _ <= kase; _++) {
int n; scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", a + i);
int Ans1 = 0, Ans2 = 0;
for (int ... | ALGO | 0.986923 | 3.347409 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c24599ed... |
b9e9d47f-3977-4fe8-a7b8-57d6f3135b3d | MonkeyCMonkeyD0/Space-Runner | server/src/PlanetCreator.cpp | #include <random>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <iostream>
#include "PlanetCreator.hpp"
char PlanetCreator::shapes[] = {'S', 'T', 'D', 'C'}; // Sphere Torus Disc Cube
PlanetCreator::PlanetCreator()
{
this->initialize();
}
void PlanetCreator::initialize()
{
floa... | ALGO | 0.914843 | 3.881665 | {
"github_metadata": {
"branch": "main",
"commit_count": 201,
"repo_created_at": "2021-03-23T09:12: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": "b5cd7cdd8a... |
49623ec5-86ef-4696-b895-d198568965c7 | onglu1/acm | codelist/POJ/2318-TOYS.cpp | //
// Created by onglu on 2022/4/12.
//
#include <iostream>
#include <cmath>
#include <cstring>
#include <vector>
#include <map>
#include <cstdio>
#include <cstdlib>
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define endl '\n'
#define lson (rt << 1)
#define rson (rt << 1 | 1)
#define Mid ((... | ALGO | 0.99971 | 4.115038 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2022-03-07T10:49:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25a84bcfb... |
e0b47c5b-d477-49e4-9b4d-c0599de7292c | ayushslg/Cp-submissions | atcoder/keyence2020/A.cpp | #include<bits/stdc++.h>
#define Imposter ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,less_equal<ll... | ALGO | 0.999886 | 3.786534 | {
"github_metadata": {
"branch": "master",
"commit_count": 521,
"repo_created_at": "2021-09-26T01:33: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": "045104ab... |
a7a82ef1-9421-4264-b58b-b78cbf06d7cc | livierggh/ID1000500B_LivierGarcia_EduardoMartinez | sw/golden_model.cpp | #include <iostream>
#include <cstdio>
#include <vector>
void read_memory_input(const char* filename, int*& arr, int& size) {
FILE* file = fopen(filename, "r");
if (file == nullptr) {
std::cerr << "Error al abrir el archivo " << filename << std::endl;
exit(1);
}
std::vector<int> temp;
... | ALGO | 0.993144 | 4.406779 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-05-27T04:42: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": "d550bf5f9b8e... |
4df05b63-0561-45b4-80c4-9bcb370a3e60 | katjawolff/custom_fit_garments | toolbox/clothsimulation/bend_quadratic_forces.h | #ifndef GARMENTSHAPE_BEND_FORCES_H
#define GARMENTSHAPE_BEND_FORCES_H
#include <vector>
#include <Eigen/Sparse>
class Bend {
private:
double k_bend;
double k_damping;
int n; // number of vertices
Eigen::MatrixXi E4; // four vertices around each interiour edge
std::vector< Eigen::Vector4d > F_local... | ALGO | 0.995425 | 5.863503 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-11-10T15:13:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "229b6036a8d... |
2efa66d5-425e-4bb7-ad31-8ae235cd4509 | valentinaschueller/sweet | src/programs/swe_sphere_timeintegrators/SWE_Sphere_TS_lg_irk_lc_erk.cpp | /*
* Author: <NAME> <<EMAIL>>
*/
#include "SWE_Sphere_TS_lg_irk_lc_erk.hpp"
void SWE_Sphere_TS_lg_irk_lc_erk::run_timestep(
SphereData_Spectral &io_phi_pert, ///< prognostic variables
SphereData_Spectral &io_vrt, ///< prognostic variables
SphereData_Spectral &io_div, ///< prognostic variables
double i_fi... | ALGO | 0.994965 | 5.742022 | {
"github_metadata": {
"branch": "master",
"commit_count": 3611,
"repo_created_at": "2021-04-29T08:40:38.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "schreiberx/sweet",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_... |
3fa66a02-5649-4181-a323-51ba41028672 | The-SS/Julia_intro | speed_test/cpp/matrix_inversion.cpp | #include <iostream>
#include <ctime>
#include <Eigen/Dense>
#include <array>
using namespace std;
using namespace Eigen;
int main()
{
clock_t time_req; // clock object
int mat_size = 5000; // matrix size
MatrixXd mat, mat_inv; // random matrix
int num_experiments = 10; // number of experiments
float total_ti... | ALGO | 0.975734 | 4.09866 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-12-04T21:20: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": "fc3395bfcc... |
b3ab91cc-b7a9-4b0a-98ff-c0825560f8dc | PRAKHARSAHUJI/Codeforces-Question | 800 RATING/Hulk.cpp | // https://codeforces.com/contest/705/problem/A
// ------------------------------------ Correct Code ---------------------------------------------
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 1; i < n; i = i + 1)
{
if (i % 2 == 0)
cout ... | ALGO | 0.999996 | 4.236966 | {
"github_metadata": {
"branch": "main",
"commit_count": 158,
"repo_created_at": "2024-04-29T18:59: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": "cf6272186d... |
00de9c05-5c76-4038-963b-f208c1640b84 | sarahaguasvivas/nlsoft | cpp/tilting/test/arduino_test_cxx.cpp | #include "neural_network_utilities.hpp"
#include "matrix.hpp"
#include "signals.hpp"
#include "figure_eight_target.hpp"
#include <math.h>
#include <iostream>
#define NUM_SIGNAL 11
#define PI 3.1415926535897932384626433832795
void print_matrix(Matrix2);
void print_array(float*, int);
unsigned long timestamp;
float c... | ALGO | 0.998714 | 3.894473 | {
"github_metadata": {
"branch": "master",
"commit_count": 602,
"repo_created_at": "2020-01-16T19:29:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34fab891... |
f3ba0023-9483-48bb-ad91-5d3697263c51 | nicolas-oliveira/alwayscodeinc | 2019/Oldest_Codes/C e C++ - Fundamentos/Exercรญcios/Lista 7 Programaรงao Descomplicada/04.cpp | /*Crie um programa que receba tres valores (obrigatoriamente maiores que zero), repre- ห
sentando as medidas dos tres lados de um tri ห angulo. Elabore funcยธ ห oes que: ห
Determinar se eles lados formam um triangulo, sabendo que: ห
O comprimento de cada lado de um triangulo ห e menor do que a soma dos outros ยด
dois la... | ALGO | 0.999222 | 4.104475 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-05-13T18:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6755f6177... |
902b1bf9-45f5-4ae2-acf1-1ee45ac788ae | jvm-coder/Hacktoberfest2022_aakash | CPP/cq.cpp | #include <iostream>
using namespace std;
const int SIZE=3;
class CQueue{
private:
int front;
int rear;
int arr[SIZE];
public:
CQueue(){
front=-1;
rear=-1;
}
bool isEmpty(){
return (front==-1 && rear==-1);
}
bool isFull(){
return (rear+1)%SIZE==f... | ALGO | 0.982904 | 3.885025 | {
"github_metadata": {
"branch": "master",
"commit_count": 820,
"repo_created_at": "2022-09-30T19:07:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 46,
"forks": 223,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "d00b5... |
9e065183-2e5b-42bb-9ffb-2867508a9f13 | shishir94/CompetitveProgramming | Codeforcescontsets/Round953/q2.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
long long modular_power(long long x, long long y, long long p)
{
long long res = 1;
while (y > 0)
{
if (y % 2 == 1)
{
res = (res * x) % p;
}
y = y >> 1;
x = (x * x) % p;
}
return r... | ALGO | 0.999846 | 3.796422 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2022-12-19T10:33: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": "cd82d5146f... |
2b2d2ac0-7633-410d-a729-2e35cdf59878 | Smarth2002/GCI_DSA_BOOTCAMP | 9. Strings/find_substring_1.cpp | //7. Write a program to find a substring within a string. If found display its starting position.
#include<bits/stdc++.h>
using namespace std;
int main()
{
string str1, str2;
getline(cin, str1);
getline(cin, str2);
int size1, size2;
for (size1 = 0; str1[size1] != '\0'; size1++);
for (size2 ... | ALGO | 0.999445 | 4.532114 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-03-13T14:04: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": "abd8001b083... |
cc9de625-f75e-45ba-b64d-603f0a29160b | yelnats8j/ENCE_3210_Jameson_Stanley | Lab_01/Lab1Project3/Lab1Project3.ino | #define INT_MIN 0
// Global integer array
int gArr[50];
void setup()
{
Serial.begin(9600); // Start serial communication
// Initialize the random seed
randomSeed(analogRead(0)); // Use analog pin A0 for randomness
// Initialize the array with random values
for (int i = 0; i < 50; i++) {
gArr[i] = ran... | ALGO | 0.999794 | 6.121712 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-01-10T17:19:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "083669c66bd... |
b2f33770-16ea-4f74-85b5-dc2cc5a568cc | zoumson/BinaryTreeVisualTraversal | include/BinTreeTraversal.h | /*
* Binary Tree
* See COPYRIGHT file at the top of the source tree.
*
* This product includes software developed by the
* STARGUE Project (http://www.stargue.org/).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Fre... | ALGO | 0.997708 | 4.102738 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-07-11T19:11: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": "cc14aea112... |
8021b323-6b8a-45d1-9f2a-f4774bc50dfd | plantepotte/FYS3150_Project_1 | src/general_main.cpp | #include <iostream>
#include <armadillo>
#include <cmath>
#include "functions.h"
#include "time.h"
using namespace std;
using namespace arma;
void general_main(int N, double h, vec& u_anal, vec& x)
{
vec a(N-1); a.fill(-1); // Vector for lower diagonal.
vec b(N); b.fill(2); // Vector for di... | ALGO | 0.99996 | 4.511064 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2020-08-27T08:22: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": "60bf8462... |
84246e55-116a-4734-9211-0f53e76f5fe2 | mr-sohel/Competitive-Programming | acm.timus.ru/1313_Some_Words_about_Sport.cpp | /**
* Author: <NAME>
* Date: 2021-12-17 22:36:23
* Task: 1313_Some_Words_about_Sport
**/
#include <bits/stdc++.h>
#define endl '\n'
#define sqr(x) (x) * (x)
#define gcd(x, y) __gcd(x, y)
#define lcm(x, y) ((x/gcd(x,y)) * y)
#define pf(x) push_front(x)
#define pb(x) push_back(x)
#define eb(x) e... | ALGO | 0.999184 | 3.768226 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2020-07-24T13:46:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1f95e0a... |
8268b200-6083-46b6-8e14-8dc45bf3025c | sachin-pal89/CPP-Programs | project_files/project_1.cpp | // In this project we will create a function which make use of object of calss
// and thus give us the distance between two pionts
#include <iostream>
#include <cmath> // This header file is use when we use mathematical function
using namespace std;
class point
{
float x, y;
static int i;
public:
friend v... | ALGO | 0.979553 | 5.328218 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-03-23T13:47: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": "308a8a3ad... |
4f093504-3575-43a2-be11-aa8293ba2298 | Kanhakhatri065/competitive_programming | BoilerplateCode/SegmentTreeLazyPropogationAddingOnSegmentsAndMaxRangeQueries.cpp | const int INF = 1e9;
const int N = 25;
int n;
vector<int> a;
int t[4 * N];
int lazy[4 * N];
void push(int node) {
t[node << 1] += lazy[node];
lazy[node << 1] += lazy[node];
t[node << 1 | 1] += lazy[node];
lazy[node << 1 | 1] += lazy[node];
lazy[node] = 0;
}
void update(int node, int tl, int ... | ALGO | 0.999945 | 4.416297 | {
"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": "9c308d313... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.