uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
b29e4415-9ec9-4ba1-b0c4-836718106155 | davrec72/clang-meta | llvm/lib/CodeGen/ScheduleDAG.cpp | #include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/ScheduleHazardRecognizer.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
... | ALGO | 0.99931 | 7.49778 |
4bf2d41e-eb8a-442c-b356-e926ae5c291a | RahulInfinity1004/Dsa | DSA Practice/3BitsMagic/3PowerOfTwo.cpp | // Power of 2
#include <iostream>
using namespace std;
bool isPower2NAIVE(int n)
{
if (n == 0)
return false;
while (n != 1)
{
if (n % 2 != 0)
{
return false;
}
n = n / 2;
}
return true;
}
// Brian Kerningam's Algorithm (n&(n-1))
... | ALGO | 0.999808 | 4.774727 |
d554c84f-e79e-4e40-b052-e87f26fdc8af | Chan531/BaekJoon_Online_Judge | 짐챙기는숌.cpp | #include <iostream>
using namespace std;
int n, m, arr[50], ans = 1;
void input()
{
cin >> n >> m;
for (int i = 0; i < n; i++)
cin >> arr[i];
}
void solution()
{
if (n == 0)
{
cout << 0;
return;
}
int rest = m;
for (int i = 0; i < n; i++)
{
if (rest < arr[i])
{
rest = m - arr[i];
ans++;
... | ALGO | 0.999915 | 3.907352 |
89d591cf-f401-4d35-b32c-8b6f21449c0e | jaiskid/amzn | STL/primevisit.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
const int n = 1000000;
ll p[n];
void primeSieve(ll n) {
p[0] = p[1] = 0;
p[2] = 1;
for (ll i = 3; i <= n; i += 2) {
p[i] = 1;
}
for (ll i = 3; i <= n; i += 2) {
if (p[i]) {
for (ll j = i * i; j <= n; j += 2 * i) {
p[j] = 0;
}
}
... | ALGO | 0.999752 | 4.203649 |
4cc40fe0-6946-4c94-8ba2-00d140628fef | xLLLxLLLx/xLLLx | vg/sx/Xutree/gg.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
typedef long long LL;
LL color[MAXN], sz[MAXN], sum[MAXN], vis[MAXN];
vector <int> tree[MAXN];
LL ans;
LL dfs(int u, int pa) {
sz[u] = 1;
LL allson = 0;
int cnt = tree[u].size();
for (int i = 0; i < cnt; i++) {
int v = tr... | ALGO | 0.999866 | 4.18272 |
31c9a2ed-e654-417e-a7bf-e6e1915057c7 | oliveinchocolat/pre-diploma-practice | main.cpp | #include <iostream>
#include <vector>
#include <stack>
#include "structures.h"
#include "read_and_write.h"
#include "generation.h"
#include "grad_algo.h"
#include "mod_grad_algo.h"
#include "get_universal_function.h"
// MAIN
int main()
{
int k;
std::cin >> k;
auto matrix_for_grad_algorith... | ALGO | 0.99844 | 5.173662 |
e60ec74e-b60e-4bc7-aeef-9a10162734e3 | dkonomis/Leetcode2025 | problems/0268-missing-number/solution.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
/**
* Problem: 0268 - Missing Number
*
* Find the missing number from range [0, n] where n = len(nums).
*
* Approach: Use mathematical formula for sum of first n natural numbers: n*(n+1)/2.
... | ALGO | 0.999912 | 7.248573 |
4695eb00-62fa-4545-a87f-791c8546c0a6 | Qipu1220/BaiTapMang1Chieu | 23520493_23521082_23521462_23521604_23521672_BT03/Bai021/Bai021.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void Nhap(float[], int&);
void Xuat(float[], int);
void LietKe(float[], int);
int main()
{
float b[100];
int k;
Nhap(b, k);
Xuat(b, k);
LietKe(b, k);
return 0;
}
void Nhap(float a[], int& n)
{
cout << "Nhap n: ";
cin >> n;
for (int i = 0; i < n; i++... | ALGO | 0.999494 | 3.437666 |
22d48a60-05f3-4e58-b51b-90f5ef25e9ce | iamakashrout/Data-Structures-and-Algorithms | 03. Matrices/rotate.cpp | #include<bits/stdc++.h>
using namespace std;
void rotate(vector<vector<int>>& matrix){
int n=matrix.size();
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
swap(matrix[i][j], matrix[j][i]);
}
}
for(int i=0; i<n; i++){
reverse(matrix[i].begin(), matrix[i].end());
... | ALGO | 0.999971 | 4.559778 |
dabd7a78-5232-4007-9733-1733ecf981e8 | kubapoke/LeetCode | Hard/Merge-k-Sorted-Lists.cpp | /**
* Definition for singly-linked list.
* 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) {}
* };
*/
class Solution {
public:
ListNode* mergeKLists... | ALGO | 0.999954 | 5.875756 |
69f9b822-60af-408f-b782-4311ea4cc3ba | liuxueyang/cpp | leetcode/contest/456/a.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include ... | ALGO | 0.999878 | 5.867013 |
cee50f75-205b-4d45-87a5-1ac63fe39ea2 | sarvex/leetcode-simula | solution/0900-0999/0944.Delete Columns to Make Sorted/Solution.cpp | class Solution {
public:
int minDeletionSize(vector<string>& strs) {
int n = strs.size();
int m = strs[0].size();
int res = 0;
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n - 1; ++j) {
if (strs[j][i] > strs[j + 1][i]) {
res++;
... | ALGO | 0.999991 | 6.254441 |
09987025-c626-4aa3-bd9a-00dde37190e8 | alexandraback/datacollection | solutions_2652486_0/C++/wychen/C.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <cassert>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FOREACH(i,c) for(typeof(c.begin()) i=(c).begin();... | ALGO | 0.999206 | 3.033133 |
45bdbf0b-f1e1-4ef1-98fd-3be7ec93e9b1 | dev-SR/exercise | C_CPP/02array_c_cpp/code/search_and_sort/0inbuilt_sort.cpp | //C++
#include <bits/stdc++.h>
using namespace std;
//Define a comparator function
bool compare(int a, int b) {
cout << "comparing " << a << " and " << b << endl;
return a > b;
}
int main() {
int n, key;
cin >> n;
int a[100];
for (int i = 0; i < n; i++)
cin >> a[i];
//Sort an arra... | ALGO | 0.999922 | 4.41161 |
c987887e-6b12-4d40-9b50-a43135bc7c37 | mhugo/octaam | icaampp/ext/newmat/evalue.cpp | //$$evalue.cpp eigen-value decomposition
#define WANT_MATH
#include "include.h"
#include "newmatap.h"
#include "newmatrm.h"
#include "precisio.h"
#ifdef use_namespace
namespace NEWMAT {
#endif
#ifdef DO_REPORT
#define REPORT { static ExeCounter ExeCount(__LINE__,17); ++ExeCount; }
#else
#d... | ALGO | 0.999953 | 4.307657 |
affdea06-0446-43eb-9ccb-219e6d6ad4a1 | alealbertini/personal | Codeforces/Lucky Ticket/main.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
string m;
cin >> n;
string s;
cin >> s;
/*for(int i=0;i<n;i++){
cin >> m;
s+=m;
}*/
bool esLucky=true;
int izq=0,der=0;
for(int i=0;i<(int)s.length() && esLucky;i++){
if(!(s[i]=='4' || s[i]=='... | ALGO | 0.99994 | 4.228835 |
6931b379-e1e4-488a-a0c8-c12c90b8d686 | farvic/tdd-clean-number-trivia-app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
2ba02c86-7d6e-4453-91ca-a0d8135f3674 | pari-1920/godot.py | thirdparty/misc/pcg.cpp | #include "pcg.h"
uint32_t pcg32_random_r(pcg32_random_t* rng)
{
uint64_t oldstate = rng->state;
// Advance internal state
rng->state = oldstate * 6364136223846793005ULL + (rng->inc|1);
// Calculate output function (XSH RR), uses old state for max ILP
uint32_t xorshifted = ((oldstate >> 18u) ^ oldst... | ALGO | 0.950994 | 6.352406 |
7a7d85cd-d196-467a-9e9a-a495fbfaa037 | ishandutta2007/codeforces | compute/normal/1209/G1.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+7;
struct Seg{
int l,r,cnt;
bool operator<(const Seg& a)const{
if(l==a.l) return r<a.r;
return l<a.l;
}
};
int a[maxn];
int fi[maxn],la[maxn],c[maxn];
int main()
{
vector<Seg> all;
int n,q;
scanf("%d%d",&n,&q);
f... | ALGO | 0.999898 | 3.754178 |
ef9063c0-4700-4363-bb26-6ae307cbfc49 | kondrak/vk_playground | src/Math.cpp | #include "Math.hpp"
namespace Math
{
/*
* 4x4 Matrix
*/
void Matrix4f::Identity()
{
m_m[0] = 1.f;
m_m[1] = 0.f;
m_m[2] = 0.f;
m_m[3] = 0.f;
m_m[4] = 0.f;
m_m[5] = 1.f;
m_m[6] = 0.f;
m_m[7] = 0.f;
m_m[8] = 0.f;
m_m[9] = 0.f;... | TOOL | 0.936499 | 6.032927 |
1dae5d6c-a88f-444f-868e-3a0c0aa141ec | raincross7/code-similarity | codes/train_code/problem121/problem121_228.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
ll N, Y;
cin >> N >> Y;
for(int i=0; i<=N; i++) {
for(int j=0; j<=N-i; j++) {
int k = N - i - j;
if(i * 1000 + j * 5000 + k * 10000 == Y) {
cout... | ALGO | 0.999834 | 4.063611 |
6228fe39-57c3-4c93-af45-05bcc39224ec | divykantsharma/Coding-Ninja-Solutions | Milestone 4/Binary Trees/Postorder Binary Tree.cpp | /**********************************************************
Following is the Binary Tree Node class structure
template <typename T>
class BinaryTreeNode {
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this -> data = data;
le... | ALGO | 0.999992 | 5.897424 |
a8ec722b-3580-48b7-9e5c-66250ce3ca85 | mohammadisa2/fic16_absensi | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
ecf9389c-317e-48bf-bc7f-f13ccd2bc34e | PiXeN-OS/frameworks_av | media/libstagefright/codecs/amrnb/common/src/syn_filt.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include <string.h>
#include "syn_filt.h"
#include "cnst.h"
#include "basic_op.h"
#include "basic_op.h"
/*-----------------------------... | ALGO | 0.999708 | 5.314509 |
8edc613c-66f1-487f-8b08-d65fef2ca4d6 | noornabi-noor/Codeforces | C_Kevin_and_Binary_Strings.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define lld long long double
#define ull unsigned long long
#define pll pair<int, int>
#define mod 1000000007
const int N = (int)1e6;
#define BISMILLAH ios_base::sync_with_stdio(0);cin.tie(0);
#define ALHAMDULILLAH return 0;
#d... | ALGO | 0.999391 | 3.534554 |
a0fe5ed1-e77c-4263-9c87-a259f4c59d16 | ckf42/leetcode-code | sol/1051/1051.cpp | struct Solution {
inline int heightChecker(vector<int>& heights) {
vector<int> expected(heights);
sort(expected.begin(), expected.end());
int res = 0;
for (int i = 0; i < heights.size(); ++i){
res += (heights[i] != expected[i]);
}
return res;
}
};
| ALGO | 0.999484 | 5.652181 |
969c7e62-1ba2-4ad4-8aa2-76ffba686e4c | Shubham-72654/Data-Structures | SinglyCir.cpp | // Singly Circular Lineked List
#include<iostream>
using namespace std;
struct node
{
int data;
struct node *next;
};
typedef struct node NODE;
typedef struct node *PNODE;
class SinglyCir
{
private:
PNODE head;
PNODE tail;
int iCount;
public:
SinglyCir();
voi... | ALGO | 0.999218 | 5.000483 |
29cac8a8-96d2-4b9a-815c-c0997eff67bb | WilliamX1/leetcode | Solutions/Sum-of-Subarray-Minimums.cpp | /* 二分法,将 arr 分成两个子数组,然后分别求解他们的 min(b) 的总和再相加,中间每次处理都需要 NlogN 的时间,*/
/* 时间复杂度:O(NlogNlogN),空间复杂度 O(NlogN) */
/* 测试用例:arr = {3,1,2,4} ans = 17 */
#include <algorithm>
#include <vector>
using LL = long long;
using namespace std;
class Solution
{
public:
const int mod = (int)1e9 + 7;
int _sumSubarrayMins(vecto... | ALGO | 0.999996 | 5.591973 |
34544037-df74-4c60-8a53-59e8737a488b | Sahil-Badkul/leetcode | 0766-toeplitz-matrix/0766-toeplitz-matrix.cpp | class Solution {
public:
bool isToeplitzMatrix(vector<vector<int>>& matrix) {
int n = matrix.size(), m = matrix[0].size();
for(int i = 0; i < n-1; i++){
for(int j = 0; j < m-1; j++){
if(matrix[i][j] != matrix[i+1][j+1]) return false;
}
}
return... | ALGO | 0.999974 | 6.346589 |
3dfc21fd-fe6e-459a-8b9c-bf071f51b5d6 | amoxu/dir-615-c1-uboot | tools/lzma_4.57/CPP/Common/CommandLineParser.cpp | // CommandLineParser.cpp
#include "StdAfx.h"
#include "CommandLineParser.h"
namespace NCommandLineParser {
void SplitCommandLine(const UString &src, UString &dest1, UString &dest2)
{
dest1.Empty();
dest2.Empty();
bool quoteMode = false;
int i;
for (i = 0; i < src.Length(); i++)
{
wchar_t c = src[i];... | TOOL | 0.947351 | 5.769485 |
1af50759-ea9a-4f1b-a890-0f17b9460a57 | 7ANJ0I2407/Competitive-Coding-Codeforces | C_White_Sheet.cpp | #include<iostream>
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#define pb push_back
#define pp pop_back
#define ll long long
#define... | ALGO | 0.995728 | 3.493095 |
e9306c3a-52e6-4021-a883-eb4fc5589e36 | joe95crone/Genetic-Algorithm-ICS-2D-Optimisation | SinglePoint_NO_DAT/spea2/spea2.cpp | /*========================================================================
APISA (www.tik.ee.ethz.ch/pisa/; www.lepp.cornell.edu/~ib38/apisa/)
========================================================================
Computer Engineering (TIK)
ETH Zurich
Cornell University
Ithaca, NY 14853
==============... | ALGO | 0.988056 | 5.480919 |
1f5643d1-229e-45e4-8e09-47d995808fb4 | kokkos/code-examples | release-briefings/3.5/partition-space/partition-space.cpp | #include <Kokkos_Core.hpp>
#include <cmath>
struct Functor {
Kokkos::View<double*> x;
int R;
KOKKOS_FUNCTION
void operator() (const int i) const {
double val = x[i];
for(int r=0; r<R; r++) {
val += val*(1./(r+i));
}
x[i] = val;
}
};
void test(int N0, int N1, int R0, int R1, bool one_ex... | ALGO | 0.994916 | 5.905759 |
243f398f-a19c-4e6c-92f9-e633102e2e4d | oheong/It-s_eong_time | 10039 평균 점수/10039 평균 점수/소스.cpp | #include <stdio.h>
int map[5], sum;
int main() {
for (int i = 0; i < 5; i++) {
scanf("%d", &map[i]);
if (map[i] < 40) sum += 40;
else sum += map[i];
}
printf("%d\n", sum / 5);
return 0;
} | ALGO | 0.999877 | 3.652597 |
174a3375-7745-4a52-a89d-8779640a4784 | HPhuonghub/code-cpp | code c++/tinh tong giai thua.cpp | #include <iostream>
using namespace std;
int main()
{
long long n,s=0;
cin >> n;
for(int i=1;i<=n;i++){
long long m=1;
for(int j=1;j<=i;j++){
m=m*j;
}
s=s+m;
}
cout << s << endl;
}
| ALGO | 0.99997 | 4.053784 |
3ab8ef1b-1b6f-45fa-b99b-7d29d77e51d0 | arisdd10/UTS-DASAR-PEMROGRAMAN | BAB 1/Logika.cpp | #include <iostream>
using namespace std;
int main()
{
double panjang, lebar;
panjang = 10;
lebar = 15;
double keliling;
keliling=2 * (panjang + lebar);
cout << "Keliling persegi panjang = "
<< keliling << endl;
return 0;
}
| TOOL | 0.991698 | 3.432872 |
261d926d-0e97-4acb-8d22-d13ccdcd63f9 | mohsystem/llm-generated-code-c-cpp | source/output/claude/cpp/Task155_CLAUDE_claude-3-5-sonnet-20240620.cpp |
#include <iostream>
#include <vector>
#include <sstream>
void heapify(std::vector<int>& arr, int n, int i) {
int largest = i;
int l = 2 * i + 1;
int r = 2 * i + 2;
if (l < n && arr[l] > arr[largest])
largest = l;
if (r < n && arr[r] > arr[largest])
largest = r;
if (largest != i... | ALGO | 0.999959 | 5.527764 |
db54ba1a-57e4-4acd-afc4-75e05b73876a | AyoubElleuch/Competitive-Programming-Solutions | Fibonacci Sequence.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define inf 1000000000
#define NIL -1;
#define sz(x) (ll)x.size()
#define boost() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
t... | ALGO | 0.999994 | 4.098626 |
64fb5707-5854-405b-9ea3-df85de87cd63 | hesu/projecteuler | 1_100/euler91/main.cpp | /*
Problem 91 - Right triangles with integer coordinates
*/
#include <iostream>
#include <ctime>
#include <map>
using namespace std;
typedef struct _coordinate
{
int x;
int y;
} coordinate;
map<int, pair<coordinate, coordinate>> g_shapes;
int getshapes(int n)
{
if (n == 0)
return 0;
int shapes = 0;
... | ALGO | 0.996761 | 4.681231 |
6f10857e-eace-4114-b360-002bf9464ea5 | Shivaji-wiz/LeetCode_Status | 1319-number-of-operations-to-make-network-connected/1319-number-of-operations-to-make-network-connected.cpp | class Solution {
public:
void DFS(unordered_map<int,vector<int>> &adj,int curr,vector<bool> &visited){
visited[curr] = true;
for(auto i: adj[curr]){
if(!visited[i]){
DFS(adj,i,visited);
}
}
}
int makeConnected(int n, vector<vector<int... | ALGO | 0.999802 | 5.72662 |
93caf502-4626-4964-8c93-faf3476a8cc2 | OferGM/CyberProject12thGrade | LoginDetectorDLL/ContourBasedPasswordDetector.cpp | #include "ContourBasedPasswordDetector.h"
#include <opencv2/imgproc.hpp>
int ContourBasedPasswordDetector::detectPasswordDots(const cv::Mat& fieldImage) const {
// Convert to grayscale if needed
cv::Mat grayField;
if (fieldImage.channels() == 3) {
cv::cvtColor(fieldImage, grayField, cv::COLOR_BGR2G... | ALGO | 0.911684 | 6.730063 |
bcc2d90e-0970-4afc-9e2f-b4baa1f002bf | akshitagit/CPP | Array/binarysearch.cpp | #include <bits/stdc++.h>
using namespace std;
// A recursive binary search function. It returns
// location of x in given array arr[l..r] is present,
// otherwise -1
int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - l) / 2;
if (arr[mid] == x)
... | ALGO | 0.999727 | 5.398533 |
44e605a5-8fb9-4298-95ba-21a017ea106e | rionislam/CodeForces | 1000/1849B/Monsters.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n, k;
cin>>n>>k;
pair<int, int> a[n];
for(int i=0; i<n; i++){
int x;
cin>>x;
if(x%k==0){
a[i].first = k;
}... | ALGO | 0.999921 | 3.144724 |
8d4d6d3d-4010-4742-8c17-65dc4716aae8 | sanjayhashcash/hcnet-core | lib/asio/asio/src/examples/cpp14/executors/fork_join.cpp | #include <asio/execution.hpp>
#include <asio/static_thread_pool.hpp>
#include <algorithm>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <queue>
#include <thread>
#include <numeric>
using asio::static_thread_pool;
namespace execution = asio::execution;
// A fixed-size thread pool used to im... | ALGO | 0.99806 | 7.596829 |
68fc6321-2e74-45ea-bc7b-283f48ade5a4 | Jack--Ma/LeetCode | Algorithm/DP/139. Word Break /WordBreak.cpp | #include "WordBreak.hpp"
/**
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
Note that the same word in the dictionary may be reused multiple times in the segmentation.
Input: s = "leetcode", wordDict = ["le... | ALGO | 0.999339 | 5.668161 |
cbd5a5ce-f43f-4fa4-a583-3d2391cae1d2 | ehmprah/coregrounds | server/ThirdParty/boost/boost_1_67_0/libs/compute/perf/perf_max_element.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/max_element.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>(rand() % 10000000);
}
int main(int argc, char *argv[])
{
... | ALGO | 0.98796 | 5.368433 |
e20d9211-1b20-471f-8af1-b5b90776cc19 | Sandigupta/AlgoZeneth_Premium- | STL-3/min_cost_to_make_equal_solved_using_top_k_element_method.cpp | // #include <bits/stdc++.h>
// using namespace std;
// #define int long long int
// signed main()
// {
// int n, k;
// cin >> n >> k;
// vector<int> v(n);
// for (int i = 0; i < n; i++)
// {
// cin >> v[i];
// }
// multiset<int> mp;
// int time = n - k + 1;
// while (time)
... | ALGO | 0.999925 | 4.586253 |
d764e06d-6236-4193-8b9e-a53dbd9495cb | MaheshTadepalli/DSA_Course | Number_Theory/Primilarity_Test/PRB01.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define FORk(i,a,b,k) for(int i=(a); i<(b); i+=k)
#define RFOR(i,a,b) for(int i=(a); i>=(b); i--)
#define RFORk(i,a,b,k) for(int i=(a); i>=(b); i-=k)
void solve() {
int n;
cin >> n;
if(n==1) {
... | ALGO | 0.999268 | 5.183414 |
0576530d-a2ee-40c3-9477-187362aa1354 | 20km-shimakaze/SthCode | code/codeforce/R/#843(div2)/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0);cout.tie(0);cin.tie(0);
#define int long long
#define endl '\n'
typedef long long ll;
typedef pair<int,int> P;
const int N=1e6+7;
const int INF=0x3f3f3f3f3f3f3f3f;
const int mod=998244353;
int cnt[N];
int n;
vector<vector<int>>v;
void wei... | ALGO | 0.999544 | 4.224457 |
d6b6ebc4-87ac-4978-a2c0-58c22511f482 | Utkarsh7772/ProblemSolving | 2073-time-needed-to-buy-tickets/2073-time-needed-to-buy-tickets.cpp | class Solution {
public:
int timeRequiredToBuy(vector<int>& tickets, int k) {
int time=0;
for(int i=0;i<tickets.size();i++)
{
if(tickets[i]<tickets[k])
time=time+tickets[i];
else
time=time+tickets[k];
if(i>k && tickets[i]>=t... | ALGO | 0.999928 | 5.81685 |
b86df3c7-6716-443d-9314-07a1c52e16ec | ImC4k/COMP2011 | matrix/matrix.cpp | #include "matrix.h"
Matrix::Matrix(){
num_row = 0;
num_col = 0;
determinant = 0;
matrix = nullptr;
}
Matrix::Matrix(int num_row, int num_col){
this->num_row = num_row;
this->num_col = num_col;
determinant = 0;
initialize_matrix();
reset(0);
}
Matrix::~Matrix(){
for(int i = 0; i < num_row;... | TOOL | 0.991247 | 3.676637 |
fc896415-a014-4e7b-b208-2b0b0e1052bb | pingchungchang/CP | CF1389A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
void solve(){
int a,b;
cin>>a>>b;
if(b < a*2)cout<<"-1 -1\n";
else cout<<a<<' '<<a*2<<'\n';
return;
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)... | ALGO | 0.999773 | 4.393594 |
dd4aba51-e463-41ee-a43e-814c33406d0f | Sakura1124/ZJU-DScode | 06-08/ex16.cpp | /************************************************************************
* 文件名:ex16.cpp
* 文件描述:
dfs应用
* 创建人: Sakura, 2020-04-26 14:46
* 版本号:1.0
* 修改记录:
************************************************************************/
#include <iostream>
using namespace std;
int dis, vn, visited[100];
struct po... | ALGO | 0.99999 | 4.41549 |
177b904c-387e-49e3-8410-53b1b5413cd5 | 5EVERE/lab_repos3.4 | lab3.4/lab3.4.cpp | // Lab_03_4.cpp
// < >
// 3.4
// , .
// 0.1
#include <iostream>
using namespace std;
int main()
{
double x; //
double y; //
double R; //
cout << "x = "; cin >> x;
cout << "y = "; cin >> y;
cout << "r = "; cin >> R;
//
if (((x * x) + (y * y) <= R * R && y >= 0) ||
(y <= 0 && y <= x && y >= ... | ALGO | 0.96725 | 4.016265 |
28e30be7-aab8-4294-aeb4-cd2e07865ea3 | nguyentuss/Competitive-Programming | CP/OnlineJudge/CodeForce/CodeForce/2051D.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define le(x) (x << 1ll)
#define ri(x) ((x << 1ll) + 1)
typede... | ALGO | 0.999859 | 4.623953 |
57ad012c-0743-492b-8260-cc15e2eae653 | chawinkn/competitive-programming | Training/Day3/Hands.cpp | #include <bits/stdc++.h>
using namespace std;
// Greedy
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n, k;
cin >> n >> k;
vector<int> t(n);
for (int i = 0; i < n; i++) cin >> t[i];
sort(t.begin(), t.end());
int ans=0;
for (int i = n-1; i >= 0; i-=k) ans += t[i];
cout << ans;
return 0;
} | ALGO | 0.999991 | 4.021674 |
232ba735-1594-4665-a7d4-a5b3d4858e92 | abhiram4580/DSA_CODE_BABBAR | array/Longest_Prefix_sum.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int lenOfLongSubarr(int A[], int N, int K)
{
// Complete the function
map<long long,int>mp;
long long sum=0;
int maxlen=0;
for(int i=0;i<N;i++){
sum+=A[i];
if(sum==K){
... | ALGO | 0.999665 | 5.13073 |
56b6fbbe-6280-4ebf-b01d-1f561b127ed9 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7857_13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
char t[n][n];
for (int i = 0; i < n; i++) scanf("%s", &t[i]);
int max = 0;
for (int i = 0; i < n; i++) {
int mapa[n], cont = 0;
for (int j = 0; j < n; j++)
if (t[i][j] == '0')
mapa[j] = 0;
else
... | ALGO | 0.999936 | 4.848001 |
0a42be2c-c544-4a11-bb8b-21f915220ceb | SatyamSivamPal/Google_Leetcode | Delete nodes having greater value on right - GFG/delete-nodes-having-greater-value-on-right.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void print(Node *root)
{
Node *temp = root;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
... | ALGO | 0.999917 | 5.351457 |
6a4105a5-038d-4b71-981b-fea134b79eb8 | Sriver27/DSA | Leaders in an array - GFG/leaders-in-an-array.cpp | //{ Driver Code Starts
// C++ program to remove recurring digits from
// a given number
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
//Function to find the leaders in the array.
public:
vector<int> leaders(int a[], int n){
// Code here
vector... | ALGO | 0.999968 | 5.936223 |
f8e1543d-9ef1-4be6-98a9-f4dfee246146 | afonsolpjr/Faculdade | Outros/Challenges/BeeCrowd/1296.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
double m[3],a,b,c,s,result[200000]={0};
int i=0,j,n_case=0;
while(cin >> m[0])
{
cin >> m[1] >> m[2];
for(i=0;i<3;i++) // checar se existe triangulo com lados m1,m2,m3 (ordernar de tal forma q m1>=m2>=m3)
... | ALGO | 0.999956 | 3.823961 |
275bb948-44e5-4a3f-b337-b21091f58f82 | Kim-jeongmin/algorithm_problem_solved | 다이나믹 프로그래밍/12865.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, K; cin >> N >> K;
vector<int> P(N+1);
vector<int> W(N+1);
vector<vector<int> > dp(N+1, vector<int>(K+1, 0));
for(int i=1;i<=N;i++) cin >> W[i] >> P[i];
for(int i=1;i<=N;i++){
for(int j=1;j<=K;j++){
if(j >= W[i]) dp[i][j] = max(d... | ALGO | 0.999951 | 3.704328 |
47b9571a-c4c9-4e89-8fba-1e2bc6a922a0 | louiepascual/competitive-programming | uva/uva12554.cpp | #include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
string lyrics[16] = {
"Happy","birthday","to","you",
"Happy","birthday","to","you",
"Happy","birthday","to","Rujia",
"Happy","birthday","to","you"
};
int main() {
//freopen("in","r",stdin);
int t;
scanf("%d",&t);
vector<string> name... | ALGO | 0.998604 | 3.581961 |
0544d1d7-4381-4cb4-b2ee-87fc123c1d89 | srgylvn/Protection-Talk | Encryptor/AdditionalLib/boost/libs/bimap/example/mi_to_b_path/hashed_indices.cpp | // Boost.Bimap Example
//-----------------------------------------------------------------------------
// Hashed indices can be used as an alternative to ordered indices when fast
// lookup is needed and sorting information is of no interest. The example
// features a word counter where duplicate entries are checked by... | ALGO | 0.995555 | 6.942595 |
b949bc0d-1070-4b39-8763-e709556c62f5 | kish1n/CompetitiveCoding | Practice/AtCoder/abc043/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int N;
cin >> N;
vector<int> v(N);
for (int i = 0; i < N; i++) {
cin >> v[i];
}
int mean = lround((static_cast<double>(accumulate(v.begin(), v.end(), 0)) / N));
int res = 0;
... | ALGO | 0.999834 | 5.331226 |
fe967b57-a194-494f-b5ef-d4d526ad269e | ishandutta2007/codeforces | abc864197532/normal/1722/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, ty... | ALGO | 0.999395 | 4.443113 |
70312ab1-5153-4ef2-8cba-f689e4ba98dc | onyet/cpp-beginner | Floyd-Warshall-Vs-Dijkstra-s-Algorithm-master/dijkstra.cpp | /*
* Author Charles Neeler (<EMAIL>)
* Class CSCE
* Date 12 NOV 15
* Project
*/
#include <iostream>
#include <chrono>
#include <fstream>
#include <limits.h>
#define INF -1
using namespace std;
using namespace std::chrono;
int main(int argc, char*argv[])
{
int size;
ifstream fs(argv[1]);
fs >> size; //take in t... | ALGO | 0.998561 | 4.249 |
64e167a7-1521-4790-adf7-1eed761524d0 | Manju567/coding_Leetcode-solutions | solution/1900-1999/1953.Maximum Number of Weeks for Which You Can Work/Solution.cpp | class Solution {
public:
long long numberOfWeeks(vector<int>& milestones) {
int mx = *max_element(milestones.begin(), milestones.end());
long long s = accumulate(milestones.begin(), milestones.end(), 0LL);
long long rest = s - mx;
return mx > rest + 1 ? rest * 2 + 1 : s;
}
}; | ALGO | 0.999983 | 5.818278 |
cb82b3bb-ee25-4585-8ae4-4f0577907127 | mufeezhanif/Leetcode_Solutions | 643-maximum-average-subarray-i/maximum-average-subarray-i.cpp | class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
int maxSum = INT_MIN;
int sum = 0, left = 0;
for (int right = 0; right < nums.size(); ++right) {
sum += nums[right];
if (right - left + 1 == k)
{
maxSum = (maxSum >... | ALGO | 0.999923 | 6.5379 |
be779deb-812f-4b6f-bd41-137a4dba452c | Fanfik235/laboratory_work_01.09-31.10 | Лаб №1/№1.cpp | #include <iostream>
using namespace std;
int main()
{
setlocale(0, ""); //
double a, b, s;
cout << "Введите длины сторон \n";
cout << "a= ";
cin >> a;
cout << "b= ";
cin >> b;
s = a * b;
cout << "S = " << s;
return 0;
} | TOOL | 0.904504 | 3.217992 |
b28892dd-3ced-47f4-bef3-ad5bb6fe4d70 | Curthaldor/godot-3.6 | thirdparty/vhacd/src/vhacdICHull.cpp | #include "vhacdICHull.h"
#include <limits>
#ifdef _MSC_VER
#pragma warning(disable:4456 4706)
#endif
namespace VHACD {
const double ICHull::sc_eps = 1.0e-15;
const int32_t ICHull::sc_dummyIndex = std::numeric_limits<int32_t>::max();
ICHull::ICHull()
{
m_isFlat = false;
}
bool ICHull::AddPoints(const Vec3<double>*... | ALGO | 0.996592 | 5.769614 |
6cdb627d-e661-4ed5-8404-d8df1cb627e3 | Nayassyl/ICPC | week3/d.cpp | #include <iostream>
#include <cmath>
#define ll long long
using namespace std;
int main(){
freopen("king2.in", "r", stdin);
freopen("king2.out", "w", stdout);
int arr[8][8], dp[9][9];
for (int i = 0; i < 8; ++i)
{
for (int j = 0; j < 8; ++j)
cin >> arr[i][j];
}
for (int i... | ALGO | 0.999678 | 3.46468 |
f70b325f-64be-4b9f-80e1-8f904449a40d | svn2github/qmcpack | branches/test-20070727/src/QMCHamiltonians/CoulombPBCAATemp.cpp | namespace qmcplusplus {
CoulombPBCAATemp::CoulombPBCAATemp(ParticleSet& ref):
PtclRef(&ref), AA(0), myGrid(0), rVs(0), FirstTime(true), myConst(0.0){
LOGMSG(" Performing long-range breakup for CoulombAATemp potential");
//AA = new LRHandlerType(ref);
d_aa = DistanceTable::add(ref);
in... | ALGO | 0.965447 | 5.898193 |
b3011d34-682a-4297-b411-47a13e065145 | hdoppelt/PC-Builder | Box2D/Collision/Shapes/b2ChainShape.cpp | #include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <new>
#include <memory.h>
b2ChainShape::~b2ChainShape()
{
b2Free(m_vertices);
m_vertices = NULL;
m_count = 0;
}
void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)
{
b2Assert(m_vertices == NULL... | ALGO | 0.970067 | 6.876169 |
344e8f88-741c-4f9f-a420-4db566e5144d | envoydead7/dsa | sheet2(loops)/histogram.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
char s;
long long N;
cin>>s>>N;
//taking n numbers input
vector<long long> v(N);
for(int i=0;i<N;i++){
cin>>v[i];
}
//printing the histogram
for(int i=0;i<N;i++){
for(int j=0;j<v[i];j++){
cout<<s;
}
cout<<endl;
}
} | ALGO | 0.99989 | 3.226497 |
35079c6c-2343-4d53-a553-3ac72435cb2c | silverwest8/Baekjoon | step7/2738.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, char* argv[]) {
int N, M, temp;
cin >> N >> M;
vector<vector<int>> matrix1(N);
vector<vector<int>> matrix2(N);
vector<vector<int>> matrix3(N);
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
... | ALGO | 0.999854 | 3.418408 |
e47ad450-4c04-4196-bf9a-07f8b4ca2ca2 | fhebert/AdaptiveRegression | src/functions.cpp | //[[Rcpp::depends(RcppEigen)]]
#include <RcppEigen.h>
#include <stdint.h>
using namespace Rcpp;
using Eigen::Map;
using Eigen::MatrixXd;
using Eigen::VectorXd;
using Eigen::ArrayXXd;
using Eigen::ArrayXd;
using Eigen::SelfAdjointEigenSolver;
using Rcpp::as;
using namespace std;
Eigen::MatrixXd SelectRows(Eigen::Matri... | ALGO | 0.99935 | 5.445242 |
e1a34251-3c79-4661-b64a-e822b90267e5 | manasbis10/code | High_Score.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
int mod = 1e9+7;
int mod_add(int a, int b, int m) {return (a % m + b % m) % m;}
int mod_mul(int a, int b, int m) {return (a % m * b % m) % m;}
int mod_sub(int a, int b, int m) {return ((a % m - b % m) + m) % m;}
int bin_exp(int base, i... | ALGO | 0.999931 | 4.832046 |
030cba5a-8eb9-4970-8d66-4fc53b98273e | AlcivanLucas/Beecrowd | iniciante/2554/2554.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
string data, melhorData;
int N, D, p, dia, mes, ano;
while (cin >> N >> D)
{
melhorData = "";
for (int i = 0; i < D; ++i)
{
cin >> data;
int pessoas = 0;
for (int j = 0... | ALGO | 0.999352 | 3.671515 |
3fd2b24b-a679-4a42-bd51-7bad952fdc9a | luaiokasha/3dAnimation | igl/triangle_fan.cpp | template <typename DerivedE, typename Derivedcap>
IGL_INLINE void igl::triangle_fan(
const Eigen::MatrixBase<DerivedE> & E,
Eigen::PlainObjectBase<Derivedcap> & cap)
{
using namespace std;
using namespace Eigen;
// Handle lame base case
if(E.size() == 0)
{
cap.resize(0,E.cols()+1);
return;
}
... | ALGO | 0.950371 | 5.14866 |
b1185277-40f4-40f9-b2bc-ca1684fa0711 | labanidas/-CrackYourInternship | 29. Text Justification.cpp | class Solution {
public:
int umaxWidth;
string getFinalLine(int i, int j, int eachWordSpace, int extraSpace,
vector<string>& words) {
string s;
for (int k = i; k < j; k++) {
s += words[k];
if (k == j - 1)
continue;
fo... | ALGO | 0.999951 | 6.336627 |
c635b2b9-7438-48f7-94e4-730df304ee7a | forestgeo/fgeo.krig | revdep/library/fgeo.krig/old/Rcpp/examples/ConvolveBenchmarks/convolve3_cpp.cpp | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
// This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
#include <Rcpp.h>
RcppExport SEXP convolve3cpp(SEXP a, SEXP b){
Rcpp::NumericVector xa(a);
Rcpp::NumericVector xb(b);
int n_xa = xa.size() ;
int n_xb = xb... | ALGO | 0.979105 | 5.93702 |
a720314a-51ae-4b43-a0b1-f2bb162483f8 | ishandutta2007/codeforces | neal/normal/1163/A.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
cout << min(max(M, 1), N - M) << '\n';
} | ALGO | 0.999822 | 3.524427 |
1e7bcdba-4a89-422f-8fa8-1be8211ac8f4 | GoldenStain/stacks_and_expressions | postfix expression solution.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stack>
#include <iostream>
using namespace std;
const int N = 1000005;
char a[20];
int top;
bool expression[N];//表达式栈
stack<char> op;//符号栈
stack<double> num;//数字栈
inline void calc()
{
double b = num.top();
num.pop();
double a = num.top();
num.pop();
... | ALGO | 0.999767 | 3.500346 |
14096096-9899-45a4-8646-ea32f43d532c | neosizzle/computorv2 | srcs/parse/tokenize.cpp | #include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include "tokens.hpp"
#include "Base.hpp"
#include "constants.hpp"
#include "ft_error.hpp"
#include "RationalNum.hpp"
#include "ImaginaryNum.hpp"
#include "Matrix.hpp"
#include "QMark.hpp"
#include "Parenthesis.hpp"
#include "Operator.hpp"
#in... | TOOL | 0.961191 | 4.242618 |
3a2c30ad-82fb-4355-9d9d-7038a95d53a4 | ethan-enhe/ANN | test.cpp | // #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,bmi,bmi2,lzcnt,popcnt")
// #define EIGEN_VECTORIZE_SSE4_2
#ifdef LOCAL
#define dbg(x) cerr << #x << " = " << (x) << endl
#else
#define dbg(...) 42
#define NDE... | ALGO | 0.948524 | 3.879411 |
0ce912b7-8fd5-4994-869d-ba25678134b0 | Ruiying-Ma/yao-noc-s23 | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_unsigned/promote_truncation/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.960632 | 5.742909 |
1ee5d063-ec7c-411b-b81b-aa26f9b8439a | JsKim4/BOJ-BaekJoon-Online-judge- | cpp/15000/15600/P15686.cpp | #include<iostream>
#include<vector>
#include<cmath>
#pragma warning (disable:4996)
#define INF 2100000000
using namespace std;
// 15686 치킨 배달
vector<pair<int, int>> home;
vector<pair<int, int>> chicken;
int city[50][50];
int mine = INF;
int chkck[13];
// i 몇번째 j 시작점 n치킨집 개수 m 폐업안시킴
void noOut(int i,int j,int m) {
if ... | ALGO | 0.999642 | 3.27534 |
3ad25891-5f9e-4b2f-bd19-42ff8f06958b | ucbrise/waldo | server/core/server.cpp | #include <fstream>
#include <thread>
#include <grpcpp/grpcpp.h>
#include <grpcpp/health_check_service_interface.h>
#include <grpcpp/ext/proto_server_reflection_plugin.h>
#include <cryptoTools/Crypto/AES.h>
#include "../../secure-indices/core/DCFTable.h"
#include "../../secure-indices/core/DPFTable.h"
#include "../../se... | WEB | 0.934695 | 5.672923 |
248d9e65-8294-4d49-b785-0ade0b6111ca | Ping6666/NCU-CE3005-B-Algorithm | WeeklyHomework/0310_Above_Average.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int N,score[100][100],sum[100],ans[100];
cin>>N;
for(int i=0;i<N;i++)
{
cin>>score[i][0];
sum[i]=0;
ans[i]=0;
for(int j=0;j<score[i][0];j++)
{
cin>>score[i][j+1];
sum[i]+=score[i][j+1];
}
for(int j=0;j<score[i][0];j++)
{... | ALGO | 0.999621 | 3.477352 |
61b8b508-cee2-48f0-b3c7-6f0e8b793800 | yutigi/unreal-4.15.1-hairwork-Nvidia | Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/GeomUtils/src/ccd/GuCCDSweepConvexMesh.cpp | #include "Ps.h"
#include "GuVecCapsule.h"
#include "GuVecBox.h"
#include "GuVecConvexHull.h"
#include "GuVecTriangle.h"
#include "GuVecShrunkConvexHull.h"
#include "GuVecShrunkBox.h"
#include "GuGJKRaycast.h"
#include "GuCCDSweepConvexMesh.h"
#include "GuHeightFieldUtil.h"
#include "PsInlineArray.h"
#include "GuEntityR... | ALGO | 0.999355 | 3.35383 |
9fa45429-1b76-4fc1-927d-bf78568f4d84 | EASINTUHA/Coding-Journey-reset | April 2025 past/B_Keep_it_Beautiful.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int>v(n);
for(int i=0;i<n;i++)
{
cin>>v[i];
}
string s="1";
int x=v[... | ALGO | 0.999984 | 4.145084 |
519ce7a4-4a08-47ad-8e1c-944db2f18891 | prakashsellathurai/a-grim-loth | cpp/Dynamic-Programming/number-problems/divide-luggage.cpp | /**
* @file divide-luggage.cpp
* @author prakash (<EMAIL>)
* @brief
Two drivers have to divide up m suitcases between them, where the weight
of the ith suitcase is wi. Give an efficient algorithm to divide up the loads so
the two drivers carry equal weight, if possible
* @version 0.1
* @date 2021-08-30
*
* @cop... | ALGO | 0.999984 | 4.426438 |
a9f43197-382d-4e8f-af4e-a9dc2b793587 | Linumm/LeetCode | 0802-find-eventual-safe-states/0802-find-eventual-safe-states.cpp | class Solution {
public:
vector<int> ans;
vector<int> eventualSafeNodes(vector<vector<int>>& graph) {
//Topological sort (transpose graph first)
// If there's a cycle, then every nodes in the cycle is not safe node (or terminal)
int n = graph.size();
vector<vector<int>> adj_trp(n... | ALGO | 0.999995 | 6.53907 |
f9d47425-293f-417c-bb33-da120b53a3df | PreslavaShtereva/ProgrammingBasics_SoftUni | For Loop - Lab/06. Vowels Sum.cpp | #include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
string n;
getline(cin,n);
int sum = 0;
for (int i = 0; i <=n.length(); i++) {
if (n[i] == 'a') {
sum++;
}
else if (n[i] == 'e') {
sum += 2;
}
else if (n[i] == 'i') {
sum += 3;
}
else if (n[i] == 'o')... | ALGO | 0.998836 | 3.871766 |
73d6b733-efb5-4714-8af3-7086cd4ec197 | ishandutta2007/codeforces | kmjp/normal/1560/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999938 | 4.186319 |
51525dbc-eebe-4670-b88f-082498e62b57 | Uniritter-Projects/opengl_pixelart_editor | Box2D-lib/Box2D/Dynamics/Joints/b2FrictionJoint.cpp | #include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
//... | ALGO | 0.990341 | 7.570709 |
b188f6b3-d6cc-4d3e-9800-6721cf8258ba | GunjanDhanuka/gem5 | src/systemc/tests/systemc/misc/v1.0/dash6/speed.cpp | /*****************************************************************************
speed.cpp -- Definition of the speedometer.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*************************************************************... | ALGO | 0.92118 | 6.052741 |
55ab5937-cac9-443d-bdae-2214976ad544 | ishandutta2007/codeforces | natsugiri/normal/231/D.cpp | #include<cstdio>
int x, y, z, x1, y1, z1;;
int a[6], r;
int main(){
scanf("%d%d%d%d%d%d", &x, &y, &z, &x1, &y1, &z1);
for (int i=0; i<6; i++) scanf("%d", a+i);
if (x<0) r+=a[4];
if (x1<x) r+=a[5];
if (y<0) r+=a[0];
if (y1<y) r+=a[1];
if (z<0) r+=a[2];
if (z1<z) r+=a[3];
printf("%d\n... | ALGO | 0.998921 | 3.099531 |
73f32b1a-efe8-49f4-8100-a2550d7ca444 | raincross7/code-similarity | codes/train_code/problem150/problem150_131.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <climits>
#define FOR(i,a,b) for(int (i)=(a);(i)<int(b);(i)++)
using namespace std;
const int MAX_V = 100; // ????????°????????§???
const int INF = INT_MAX;
int v; // ????????°
int g[MAX_V][MAX_V]; // ??£??\??????
int d[MAX_V][MAX_V]; // ????????????... | ALGO | 0.999953 | 4.234298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.