uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f7fc03e0-1255-41be-90e0-18f34b7195ac | isoCyanide13/Cf | CP_Sheet/800/A1805.cpp | #include<bits/stdc++.h>
using namespace std;
void need_zero() {
int n;
cin >> n;
vector<int> a(n);
for(int& ele: a) {
cin >> ele;
}
int res = 0;
if(n%2 != 0) {
for(int& ele : a) {
res ^= ele;
}
}
else {
for(int& ele : a) {
re... | ALGO | 0.999577 | 4.912028 |
7823f464-6dc4-475d-be4b-a26acb38eddb | Nutzchannel/TSGYEP | cocos2d/tools/simulator/libsimulator/lib/ProjectConfig/ProjectConfig.cpp |
#include <sstream>
#include "ProjectConfig/ProjectConfig.h"
#include "ProjectConfig/SimulatorConfig.h"
#ifdef _MSC_VER
#define strcasecmp _stricmp
#endif
#if defined(_WINDOWS)
#define DIRECTORY_SEPARATOR "\\"
#define DIRECTORY_SEPARATOR_CHAR '\\'
#else
#define DIRECTORY_SEPARATOR "/"
#define DIRECTORY_SEPARATOR_CHA... | TOOL | 0.988666 | 5.933113 |
5490c842-aa79-47fb-9d1e-09d88d226ffd | alexanderKalema/MacDock_flutter-lookalike | 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.998733 | 6.76775 |
52f1bdb0-06a5-48a1-a462-91109126f552 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11004_13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, counter = 0;
cin >> n;
for (int i = 1; i <= 1000000000; i++) {
if (n >= 100) {
n = n - 100;
counter++;
} else if (n >= 20) {
n = n - 20;
counter++;
} else if (n >= 10) {
n = n - 10;
counter++;
} e... | ALGO | 0.999681 | 4.042598 |
2c116e23-ceae-4c50-af9b-71619c1e039e | ck89119/Algorithm | apac/2015/Round_D/B.cpp | /*
ID: ck89119
PROG:
LANG: C++
*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <fstream>
#include <iostre... | ALGO | 0.99957 | 3.691396 |
f5bf8eb2-9ac4-4791-973c-23a4e7a0934f | youssefelmougy/jaccard-selector | Selector/hclib/test/performance-regression/full-apps/qmcpack/src/QMCDrivers/DMC/WalkerReconfigurationMPI.cpp | using namespace qmcplusplus;
/** default constructor
*
* set SwapMode
*/
WalkerReconfigurationMPI::WalkerReconfigurationMPI(Communicate* c):
WalkerControlBase(c), TotalWalkers(0)
{
SwapMode=1;
UnitZeta=Random();
myComm->bcast(UnitZeta);
app_log() << " First weight [0,1) for reconfiguration =" << UnitZeta... | TOOL | 0.958929 | 4.895308 |
111ac49a-6653-46e2-8452-e7d853a36d0f | Guminsung/Algorithm | BOJ/1931.cpp | #include <iostream>
#include <algorithm>
#include <deque>
using namespace std;
deque<pair<unsigned int, unsigned int>> p;
bool compare(pair<unsigned int, unsigned int> a, pair<unsigned int, unsigned int> b);
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, c = 0;
... | ALGO | 0.999963 | 4.755608 |
c3255cdf-3546-416a-a994-d1b975378664 | nawngs/CompetitiveProgramming | Exercises/QueryMaxSL.cpp | #include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
ll n, q, a[100005], cnt = 0, dp[200005];
pair < ll, pair < ll, ll > > p[100005];
struct Node{
ll maxa;
ll cnt;
} it[800005];
struct Data{
bool isquery;
ll val;
ll pos;
} st[200005];
bool cmp(Data x, Data y){
... | ALGO | 0.999701 | 3.860753 |
6b624bd9-72f8-43d2-985d-508b5a9bd6b5 | GhassenMallek/nftMarket | nftmakrket/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.997838 | 6.785645 |
2a7215d0-2641-49bd-9626-afe07247f10b | Oskarowski/Codewars | C++/6_kyu/Find_the_odd_int.cpp | #include <vector>
#include <iostream>
#include <map>
using namespace std;
int findOdd(const std::vector<int> &numbers)
{
map<int, int> occurring;
for (int n : numbers)
{
if (occurring.find(n) == occurring.end())
{
occurring.insert(make_pair(n, 1));
}
else
... | ALGO | 0.999688 | 5.378247 |
82243f91-a756-43c4-94e4-7df2ae0d979f | cj2448/LeetCode | Medium/3 Longest Substring Without Repeating Characters.cpp | #include <string>
#include <algorithm>
using std::string;
using std::fill_n;
class Solution {
public:
int lengthOfLongestSubstring(string s) {
if (s.size() <= 1)
return s.size();
bool seen[128] = {false};
auto max = 0;
for (auto i = 0; i < s.size()-1; ... | ALGO | 0.999818 | 5.971807 |
1233dc17-ed19-4859-90ba-ad37f2b7a551 | QWERTYistoobasic/LeetCode | 2215-find-the-difference-of-two-arrays/2215-find-the-difference-of-two-arrays.cpp | class Solution {
public:
vector<vector<int>> findDifference(vector<int>& nums1, vector<int>& nums2) {
vector<vector<int>>dp(2);
for(int i=0;i<nums1.size();i++)
{
if(find(nums2.begin(),nums2.end(),nums1[i])==nums2.end()&&find(dp[0].begin(),dp[0].end(),nums1[i])==dp[0].end())
... | ALGO | 0.999942 | 5.788653 |
eaaf86fc-31e1-4509-b67e-69fc40c54634 | Satyam-79/Cpp | Learning/NL_3_44_pow.cpp | #include <iostream>
using namespace std;
int main()
{
int num,i,n;
long int result=1;
cout<<"\nEnter the number : ";
cin>>num;
cout<<"\nPower to calculate : ";
cin>>n;
for ( i = 1; i <= n; i++)
{
result=result*num;
}
cout<<"\n pow("<<num<<","<<n<<") = "<<result;
... | ALGO | 0.999735 | 4.643831 |
75380404-2805-492f-93f0-948f4221ce18 | AdoptOpenJDK/openjdk-jdk12u | src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp | #include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/collectorPolicy.hpp"
#include "gc/shared/gcConfig.hpp"
#include "gc/shared/jvmFlagConstraintsGC.hpp"
#include "gc/shared/plab.hpp"
#include "gc/shared/threadLocalAllocBuffer.hpp"
#include "runtime/arguments.hpp"
#include "runtime/glob... | TOOL | 0.908836 | 7.186084 |
2cd35814-7cb7-4988-9ea8-f5da940b4a6d | Mrtriste/Leetcode | Solutions/518.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int change(int amount, vector<int>& coins) {
if(amount<=0) return 1;
vector<int> dp(amount+1, 0);
dp[0] = 1;
for(int j=0;j<coins.size();++j)
for(int i=1;i<=amount;++i)
if(i-coins[j]>=0... | ALGO | 0.999857 | 4.720795 |
e3b36861-0278-4072-9673-762acd8bcbb6 | javalosv/files | eigen-eigen-b30b87236a1b/bench/sparse_transpose.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef... | ALGO | 0.982854 | 5.110691 |
d42c2d9e-635b-4267-be64-ce4ff33a75c9 | MasoodMohd26/DSA_Practice | Assignment_4/WaveRow.cpp | #include<iostream>
using namespace std;
void WaveRow(int arr[][])
{
cout << arr[0][0];
cout << arr[0][1];
cout << arr[1][0];
cout << arr[1][1];
}
int main() {
int arr[2][2] = {{1,2}, {3,4}};
WaveRow(arr);
return 0;
} | ALGO | 0.989567 | 3.208638 |
fad24d37-7970-4a6b-a8f7-01d5bd62ccf9 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt35/Codenet/p02403/624633821/response_2.cpp | #include <iostream>
#include <vector>
int main() {
int a = 0;
std::vector<int> H, W;
while (true) {
int h, w;
std::cin >> h >> w;
if (h == 0 && w == 0)
break;
H.push_back(h);
W.push_back(w);
a++;
}
for (int b = 0; b < a; b++) {
for (int i = 0; i < H[b]; i++) ... | ALGO | 0.997088 | 3.985965 |
510aedf2-9e4a-4a69-9ae6-5934bb6260b6 | mohannashahrad/Unified-Particle-Solver-Fluid-Simulation | thirdparty/eigen-3.4.0/bench/benchEigenSolver.cpp |
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver
// options:
// -DBENCH_GMM
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/QR>
#in... | TOOL | 0.985913 | 5.752874 |
6c6a7017-9d5a-4b10-8920-63c68b09ac50 | spooky1703/etapa1_OMI | 23abril/recursividad/fibonacci2.cpp | #include <iostream>
using namespace std;
int fibonacci(int n, int fib[]){
if(n==0 || n<=1){
return 1;
}
if(fib[n]!= 0){
return fib[n];
}
int r= fibonacci(n-1, fib) + fibonacci(n-2, fib);
fib[n] = r;
return r;
}
int main(){
int n;
cin>>n;
int fib[n];
for(int i... | ALGO | 0.999901 | 4.339309 |
19f903a1-cd19-45cc-9312-3bec66b7b51c | jdimauro/witch-lights | arduino/lib/FastLED-3.1.3/bitswap.cpp | #define FASTLED_INTERNAL
#include "FastLED.h"
/// Simplified form of bits rotating function. Based on code found here - http://www.hackersdelight.org/hdcodetxt/transpose8.c.txt - rotating
/// data into LSB for a faster write (the code using this data can happily walk the array backwards)
void transpose8x1_noinline(un... | ALGO | 0.985894 | 5.11307 |
0f84d8d9-c67a-4b7e-a1f0-54509261c2e3 | marlonparanhos/TP-IA | Macacos/macaco.cpp | #include "macaco.h"
#include <cstdlib>
#include <iostream>
#include <limits>
#include <estatisticas.h>
using namespace std;
double macaco::getRaioAlarmes() const
{
return raioAlarmes;
}
void macaco::setRaioAlarmes(double value)
{
vivo = true;
raioAlarmes = value;
}
void macaco::analisarArredores( vector<... | ALGO | 0.976014 | 5.216917 |
60920961-871c-4bb9-a737-77ced581fb35 | oangelo/SeriesAnalysis | src/rp.cpp | #include "rp.h"
//######################################################################################
//#################################***Public Methods***#################################
//######################################################################################
RecurrencePlot::RecurrencePlot(cons... | ALGO | 0.998925 | 5.31311 |
5e99543e-c378-41d1-b8c3-183c3fcf957c | cognitive-robots/SimCARSv2 | src/agents/causal/variable_types/endogenous/calc_fwd_car_action_outcome_reward.cpp |
#include <ori/simcars/agents/causal/variable_types/endogenous/calc_fwd_car_action_outcome_reward.hpp>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <iostream>
namespace ori
{
namespace simcars
{
namespace agents
{
namespace causal
{
CalcFWDCarActionOutcomeRewardVariable::CalcFWDCarActionOutcomeRewardVariab... | ALGO | 0.97273 | 5.907349 |
d3e6cfd3-9afe-42fe-bd76-b71cc3c56dcd | ashay1001/Leetcode | Easy/34. Binary Tree Postorder Traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999929 | 6.10919 |
bd71f3ea-7d2b-4265-9f1a-822d82bd1ecf | Eriprez/PerezEric_CIS_47948 | Hmwk/Assignment_4/Gaddis_8thEd_Chap5_Prob7_PenniesForPay/main.cpp | /*
* File: main.cpp
* Author: Eric Perez
* Created on October 18th,2018,8:07pm
* Purpose: Pennies for Pay
*/
//System Libraries Here
#include <iostream> //I/O Library
#include <cmath>//Math functions
using namespace std;
//User Libraries Here
//Global Constants Only, No Global Variables
//Like PI, e, Gravity, o... | ALGO | 0.99369 | 3.604182 |
82ca0f54-a6ba-40eb-b614-e7d958dbaa3e | Dharnesh67/decode-cpp | ARRAY/sumof_elements_in_array.cpp | #include <iostream>
using namespace std;
int main()
{
int sum = 0;
int arr[9] = {1, 2, 3, 44, 55, 33, 6, 7, 8};
for (int i = 0; i < 9; i++)
{
sum += arr[i];
}
cout << sum;
return 0;
}
| ALGO | 0.999406 | 3.207156 |
abf27426-37b9-46ac-b0a4-6e34495bf027 | nayanGowdaM/LeetCodeSolns | 1029-vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.036677 |
ffe1afe7-f57a-440d-933b-2ead74e85f61 | WenjieZhang1/leetcode | uniquenums.cpp | #include <cstdlib>
#include <iostream>
#include <ctime>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution
{
public:
vector<int> uniquenums(vector<int> &nums){
unordered_map<int,int> mymap;
int ss=nums.size();
for(int i=0; i<ss; ++i){
if(mymap.find(nums[i])!=mymap.end()){
mymap... | ALGO | 0.999906 | 5.366218 |
c3cd856b-7209-4111-86df-9c249dbec49b | teefhub/ctci | C++/Chapter 1/Question1_3/Question1_3.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include "Question1_3.h"
using namespace std;
bool Question1_3::permutation(const string& a, const string& b)
{
// Create a copy of the two strings, we do not wish to modify those that were passed as parameters.
string str_a(a);
string str_b(b);
... | ALGO | 0.999395 | 4.749885 |
ed59d110-9691-423a-8937-e6a71105eea9 | Alihammad333/DEP-Mini-Projects | Task 2.cpp | #include <iostream>
#include <vector>
#include <string>
class Contact {
public:
Contact(const std::string& name, const std::string& phone)
: name(name), phone(phone) {}
std::string getName() const { return name; }
std::string getPhone() const { return phone; }
private:
std::string name;
s... | TOOL | 0.927875 | 6.576412 |
f2b4e3ed-0ad2-427e-b09b-e83c3bf61135 | eric-gitta-moore/algorithm | old/传智杯决赛/答案/3.cpp | #include <array>
#include <iostream>
#include <algorithm>
const int maxn = 1005;
std::array<int, maxn> a, b, c, d;
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(0);
std::freopen("./3.in", "r", stdin);
int T, n;
for (std::cin >> T; T; --T)
{
std::cin >> n;
a.fill... | ALGO | 0.999828 | 3.190166 |
a24ed7dd-2bb9-4eb9-ac82-c33c8c8d4f69 | flknwr/boost | libs/numeric/ublas/doc/samples/triangular_matrix.cpp | #include <boost/numeric/ublas/triangular.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
triangular_matrix<double, lower> ml (3, 3);
for (unsigned i = 0; i < ml.size1 (); ++ i)
for (unsigned j = 0; j <= i; ++ j)
ml (i, j) = 3 * i + j;
... | ALGO | 0.94895 | 3.772041 |
592fb5d5-71dd-4aae-8a62-db687e29b7a3 | veenits123/SDE-Sheet | left_view_binary_tree.cpp | // never the same!!
#include <iostream>
#include <cstdio>
#include <cmath>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <iomanip>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>
using namespace std;
/*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/
... | ALGO | 0.999983 | 4.897666 |
8249511b-d409-4205-86b2-9c632654d445 | sarvex/leetcode-assembly | solution/0600-0699/0671.Second Minimum Node In a Binary Tree/Solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999998 | 6.364854 |
f688828a-9c7d-492f-9099-307712904739 | as468579/Leetcode | cplusplus/easy/ArrayPartitionI.cpp | class Solution {
public:
int arrayPairSum(vector<int>& nums) {
sort(nums.begin(), nums.end());
int sum=0;
for(int i=0; i<nums.size(); i=i+2){
sum += nums[i];
}
return sum;
}
}; | ALGO | 0.99985 | 5.845386 |
3983c997-8f0f-4912-853c-975c80a5bdf0 | satpathyshubham/CPP-101 | LinkedList/ReorderList.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(){
val=0;
next=NULL;
}
Node(int val){
this->val=val;
next=NULL;
}
};
class ListNode{
public:
Node* head;
No... | ALGO | 0.999928 | 4.475872 |
30bbc52c-fa79-4363-a7c8-35e86ea9c6e2 | gustavomuller99/Algo | zOld/armchairs/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans = 0; cin>>n;
vector<int> a(n);
for (int i = 0; i < n; ++i) cin>>a[i];
for (int i = 0; i < n; ++i) {
if(a[i] == 1) {
int l=INT_MAX, r=INT_MAX;
for (int j = i-1; j >= 0; --j) {
if(a[j] ==... | ALGO | 0.999894 | 3.45627 |
3cb75371-f9ae-4f12-a087-acc5cb537684 | md-jonayed/Phitron_Course | Semester 1/DSA/Module 8( Assignment 2)/test.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
this->next = NULL;
}
};
void insertHead(Node *&head, int value)
{
Node *newNode = new Node(value);
newNode->next = head;
head = newNode;
}
voi... | ALGO | 0.999805 | 4.555394 |
bc741a83-5cd1-48b0-a77e-16b790c86545 | ashnove/cp-submissions | atcoder/abc180/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define F first
#define S second
#define endl "\n"
#define nl cout<<endl;
#define pb push_back
#define f(i,a,b) for(ll i=a;i<b;i++)
#define Knucklehead ios_base::sync_with_stdio(false);cin.tie(NULL);
//#define mod 100000007
#define mat vector<vector... | ALGO | 0.999484 | 3.676852 |
c4910fa6-c422-4bd5-8229-a5afeb69c596 | isaaclo97/programacion-competitiva | Problemas/Acepta el Reto/222.cpp | #include <bits/stdc++.h>
#define INF 0x3F3F3F3F
using namespace std;
int solve(int x, int n) {
int aux, ret; aux=ret= 1;
for(int i=0; i< n;i++) {
aux *= x;
aux %= 1000007;
ret += aux;
ret %= 1000007;
}
return ret;
}
int main()
{
int n, x;
while(scanf("%d%d",... | ALGO | 0.999852 | 4.213113 |
c8c9eaf6-d6c0-4d42-ae9b-0f0df8bca138 | sahilisme/TECH_INTERN23 | Level 1/treesort.cpp |
#include <vector>
#include <iostream>
using namespace std;
struct Node
{
int data;
struct Node *left,*right;
};
struct Node *newnode(int key)
{
struct Node *temp=new Node;
temp->data=key;
temp->left=NULL;
temp->right=NULL;
return temp;
}
Node* insert(Node *node,int key)
{
if(node==NULL) return newnode... | ALGO | 0.999962 | 5.051702 |
778fde22-28af-435c-802d-4a99f1a461ca | berg223/berg223.github.io | docs/search/code/astar/astar_2.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
const int maxn = 5010;
const int maxm = 400010;
const double inf = 2e9;
int n, m, k, u, v, cur, h[maxn], nxt[maxm], p[maxm], cnt[maxn], ans;
int cur1, h1[maxn], nxt1[maxm], p1[maxm];
double e, ww, w[maxm], f[maxn];
double w1... | ALGO | 0.999995 | 3.612557 |
f02151d9-b33b-4510-a708-ec76232c789a | GAarushi123/DSA | c++/functions/4evenorodd.cpp | #include<iostream>
using namespace std;
void evenodd(int num){
if(num%2==0)
{
cout<<"even"<<endl;
}
else{
cout<<"odd"<<endl;
}
}
int main(){
int a;
cout<<"Enter the value of a:";
cin>>a;
evenodd(a);
return 0;
} | ALGO | 0.999521 | 3.483393 |
e0075083-9a13-48e4-80ac-a94ed29adbb5 | prabhxjottsingh/leetcode-practise-problems | BFS (Breadth First Search)/1926 - Nearest Exit from Entrance in Maze.cpp | // Problem Link: https://leetcode.com/problems/nearest-exit-from-entrance-in-maze/
// Time Complexity: O(N * M)
// Space Complexity: O(N * M)
class Solution
{
public:
int nearestExit(vector<vector<char>> &maze, vector<int> &entrance)
{
queue<pair<int, pair<int, int>>> q;
q.push({0, {entrance[0... | ALGO | 0.999864 | 6.28487 |
629bcb9b-4dce-48df-939e-35d54bd1330c | rishavranjandtu/DSA_Leetcode | 13-roman-to-integer/13-roman-to-integer.cpp | class Solution {
public:
int romanToInt(string s) {
unordered_map<char,int> mp{
{'I',1},
{'V',5},
{'X',10},
{'L',50},
{'C',100},
{'D',500},
{'M',1000}};
int ans =0;
int i;
for(i=1;i<s.length();i++){
if(mp[s... | ALGO | 0.999765 | 6.278561 |
a3f5fc62-45b7-4260-8ac2-b06f97e5f850 | Hsbnn/LROOPLabs | thirdLab/trapezia.cpp | #include "trapezia.hpp"
using namespace std;
Trapezia::Trapezia() : po{Point(), Point(), Point(), Point()} {}
Trapezia::Trapezia(Point& p1, Point& p2, Point& p3, Point& p4) : po{p1, p2, p3, p4} {}
Point Trapezia::center() const {
//cout << "Trapezia center() " << endl;
double x = 0, y = 0;
for(size_t i... | ALGO | 0.988294 | 4.72647 |
b6b212e2-3b3e-40f1-acb9-0e0e7d1becf5 | windpupil/HDU-DigitalMediaTechnology | 数据结构/理论课作业/01-07-H-2.cpp | //实现堆排序
#include <iostream>
using namespace std;
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
//构造大根堆,向上调整
void HeapInsert(int *array, int i)
{
int temp = array[i];
while (i > 0 && temp > array[(i - 1) / 2])
{
array[i] = array[(i - 1) / 2];
i = (i - 1) / 2;
}
... | ALGO | 0.999995 | 4.095721 |
92f3966b-1592-4148-8c4d-5775cfa404da | ishandutta2007/codeforces | risujiroh/normal/1111/D.cpp | #include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
tem... | ALGO | 0.999892 | 5.166124 |
0e1593e1-febc-4db2-89de-fc752c908c85 | luxroot/baekjoon | old/4344/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n,m,i,j;
cin >> n;
for(i=0;i<n;i++){
cin >> m;
vector<int> arr;
arr.reserve(m);
double sum=0;
for(j=0;j<m;j++){
cin >> arr[j];
sum += arr[j];
}
int cn... | ALGO | 0.99909 | 4.151184 |
140b4f2f-c290-4284-a7d3-a7da7b138f4c | knaeeim/XPSC | week-5/Day-6/D_Fast_search.cpp | #include<bits/stdc++.h>
using namespace std;
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define endl "\n"
#define ll long long int
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define vi vector<int>
#define vll vector<ll>
#define vp vector<pair<ll,ll>>
#define sorta... | ALGO | 0.999952 | 4.763757 |
8c7252b4-d382-4ddb-8ed6-d35ab8457342 | kaiumuddin/DSA-Codes | Graph_Phitron/Knight_Moves.cpp | #include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
const int N = 1e2 + 2;
vector<vector<bool>> vis(N, vector<bool>(N, false));
vector<vector<int>> dis(N, vector<int>(N, 0));
int n, m;
vector<vector<int>> path = { {1,2}, {1,-2}, {-1,2}, {-1,-2},
{2,1}, {2,-1}, {-2, 1}, {-2,... | ALGO | 0.999968 | 4.708283 |
4baf672d-e006-4f74-906d-c28c692fd08d | Indithem/COL215-Software-Assignment-2 | get_inputs.cpp | #include<fstream>
#include<sstream>
#include"gates.h"
Signal* get_signal_from_inps(const std::string& inp,const std::unordered_map<std::string,Signal*>& primary_inps, const std::unordered_map<std::string,Signal*>& internal, const std::unordered_map<std::string,Signal*>& primary_outs)
{
auto signal = internal.find... | TOOL | 0.894583 | 3.569663 |
be75eb6b-9a8c-4621-a4d3-cde6c986e7be | SimonQida/blood-in-leetcode | c++/797/test.cpp | #include<iostream>
#include "gtest/gtest.h"
#include "solution.h"
TEST(TEST, TESTforGTEST){
EXPECT_EQ(1, 1);
Solution s;
vector<vector<int> > data{{4,3,1}, {3,2,4}, {3}, {4}, {}};
vector<vector<int> >result = s.allPathsSourceTarget(data);
EXPECT_EQ(result.size(), 5);
for(int i =0; i < result.si... | TEST | 0.954408 | 4.874764 |
22fe82ca-6f9c-4fc7-8325-0b616ee79296 | ReneArevalo13/redis | src/12/hashtable.cpp | #include <assert.h>
#include <stdlib.h>
#include "hashtable.h"
// n must be a power of 2
static void h_init(HTab *htab, size_t n) {
assert(n > 0 && ((n - 1) & n) == 0);
htab->tab = (HNode **)calloc(sizeof(HNode *), n);
htab->mask = n - 1;
htab->size = 0;
}
// hashtable insertion
// list insertion
stat... | ALGO | 0.998146 | 5.891791 |
daea9b0f-4700-4fd7-82ec-c7cfde6ac978 | Sambit57/LeetCode | C++/minimum-time-to-repair-cars.cpp | // Time: O(mx * log(mn * c^2)) = O(mx * (logc + log(mn))), c = cars, mx = max(ranks), mn = min(ranks)
// Space: O(mx)
// freq table, binary search
class Solution {
public:
long long repairCars(vector<int>& ranks, int cars) {
unordered_map<int, int> cnt;
for (const auto& r : ranks) {
++... | ALGO | 0.999963 | 6.107951 |
a8942fd4-e92d-451b-8b08-f4e2460ced18 | Cpasjuste/fba | src/burn/burn_sound.cpp | #include "burnint.h"
#include "burn_sound.h"
INT16 Precalc[4096 *4];
// Routine used to precalculate the table used for interpolation
INT32 cmc_4p_Precalc()
{
INT32 a, x, x2, x3;
for (a = 0; a < 4096; a++) {
x = a * 4; // x = 0..16384
x2 = x * x / 16384; // pow(x, 2);
x3 = x2 * x / 16384; // pow(x, 3);
... | ALGO | 0.969746 | 4.959522 |
e7a671a3-9393-4b3e-9df1-854db7a96567 | sramirezh/Lammps_mods | src/MOLECULE/angle_cosine_periodic.cpp | /* ----------------------------------------------------------------------
Contributing author: Tod A Pascal (Caltech)
------------------------------------------------------------------------- */
#include "angle_cosine_periodic.h"
#include <mpi.h>
#include <cmath>
#include "atom.h"
#include "neighbor.h"
#include "do... | ALGO | 0.998673 | 5.783288 |
ecbd01fc-4f84-4a71-839b-bc8052f487bf | sumeragizzz/atcoder | src/ABC/048/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x;
cin >> a >> b >> x;
cout << b / x - max(a - 1, 0ll) / x + (a == 0 ? 1 : 0) << endl;
}
| ALGO | 0.999381 | 4.003971 |
0c29dee3-7bc1-49a2-9dc8-61fa0cc485ad | WheatZhang/interface_src | Algorithm/IpFilter.cpp | #include "IpFilter.hpp"
#include "IpJournalist.hpp"
namespace Ipopt
{
#if IPOPT_VERBOSITY > 0
static const Index dbg_verbosity = 0;
#endif
///////////////////////////////////////////////////////////////////////////
// Filter entries //
//////////////////////////... | TOOL | 0.994721 | 6.2191 |
3792164b-3dfb-458f-9862-728ae87ddd60 | ytrsk/ICPC_training_respository | OJ/codeforces/637div1/B.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define sqr(x) (x)*(x)
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
const int maxn=100007;
const ll inf=0x3f3f3f3f;
const int mod=998244353;
#define rep(i,x,y) for(auto i=(x);i<=(y);++i)
#define dep(i,x,y) for(auto i=(x);i>=(y);--i)
int read(){
... | ALGO | 0.999963 | 3.729409 |
fd26033b-12f6-45c2-8098-93a254ea8eb4 | ss5ssmi/OJ | codeforce/CF_1256A.cpp | #include<stdio.h>
int main(){
int t,a,b,n,s;
scanf("%d",&t);
while(t--){
scanf("%d %d %d %d",&a,&b,&n,&s);
int tmp = s/n;
tmp = tmp >= a ? a : tmp;
if( (s - (tmp * n)) <= b ){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}
| ALGO | 0.998615 | 3.179438 |
e8ac82c5-856d-4e00-a531-3f754a47137f | UsusCimex/NSU_ComputationalMath | Dichotomy/solve.cpp | #include <iostream>
#include <math.h>
#include <vector>
#include <string>
double cubicEquation(double a, double b, double c, double d, double x) {
return (a * x * x * x) + (b * x * x) + (c * x) + (d);
}
double quadraticEquation(double a, double b, double c, double x) {
return (a * x * x) + (b * x) + (c);
}
s... | ALGO | 0.999883 | 4.487855 |
2765f101-0dfe-41ef-a284-e38ad450a79e | yijiufly/pintool-script | pin/source/tools/SimpleExamples/regmix.cpp | /*! @file
* This file contains a static and dynamic register mix profiler
*/
#include "pin.H"
#include <list>
#include <iostream>
#include <fstream>
using std::cerr;
using std::endl;
using std::list;
using std::string;
/* ===================================================================== */
/* Commandline Switc... | TOOL | 0.960023 | 6.384174 |
ccd36593-6afd-4868-9b3e-620f96adf515 | ADS-bot/Leetcode | 1771-sell-diminishing-valued-colored-balls/1771-sell-diminishing-valued-colored-balls.cpp | class Solution {
public:
int maxProfit(vector<int>& inventory, int orders) {
long ans = 0, mod = 1e9 + 7;
int i = 0, n = inventory.size();
sort(inventory.rbegin(), inventory.rend());
while (orders > 0) {
while (i < n && inventory[i] >= inventory[0]) {
++i;... | ALGO | 0.999914 | 5.768879 |
957d75f2-d2a2-4169-8851-6b611d874f60 | Mickeyyayaya/Itsa_407410078 | AR02.cpp | #include<iostream>
using namespace std;
int main()
{
int coef[3];
cin>> coef[2] >> coef[1] >> coef[0];
int temp[100000], ans[100000], times, highest, i, j, k;
cin>>times;
temp[0]=1;
highest=0;
for(i=0; i<times; i++)
{
for(j=0; j<=highest+2; j++)
ans[j]=0; //on... | ALGO | 0.999815 | 3.125469 |
e94beae2-4243-44ad-a152-8d9c533412bc | Jack-An-14/CppStudy | STL/algorithm_19.cpp | //set算法
//交、并、差
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
void test1(){
vector<int> v1;
vector<int> v2;
v1.push_back(10);
v1.push_back(20);
v1.push_back(30);
v1.push_back(40);
v2.push_back(20);
v2.push_back(40);
v2.push_back(50);
vector<i... | ALGO | 0.997764 | 3.494381 |
9d457e55-fb06-40cb-9d51-c0c10bf20884 | subodra999/Spoj-Solution | APS.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define nax 1000005
#define inf 100000000000000000LL
#define pb push_back
#define mp make_pair
#define in insert
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector... | ALGO | 0.999955 | 4.229805 |
1727f8c6-cbf0-4853-8688-a7f881175bef | Batishavo/Competitive-programing | 2023/03-marzo/A_WastedTime.cpp | #include <bits/stdc++.h>
using namespace std;
int n,
k,
actual_x,
actual_y,
x,
y;
double answer = 0.0;
double dis()
{
return sqrt(pow(actual_x - x, 2) + pow(actual_y - y, 2) * 1.0);
}
int main()
{
cin >> n >> k >> x >> y;
for (int i = 1; i < n; i++)
{
cin >> actual_x >... | ALGO | 0.999661 | 4.117726 |
848b8ea0-02e4-45b6-9e2a-aa6d97d763bf | seclab-fudan/SyzDirect | source/llvm-project-new/libcxx/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class chi_squared_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <cassert>
#include <vector>
#include <numeric>
#include <cstddef>
#include "test_macros.h"
template <class T>
inline
T
sqr... | TEST | 0.886843 | 4.701449 |
e5598d91-9c1f-4e6a-8525-9ff4ab7d66c3 | davehorton/ssp | deps/boost_1_55_0/libs/graph/example/kevin-bacon.cpp | using namespace boost;
template <typename DistanceMap>
class bacon_number_recorder : public default_bfs_visitor
{
public:
bacon_number_recorder(DistanceMap dist) : d(dist) { }
template <typename Edge, typename Graph>
void tree_edge(Edge e, const Graph& g) const
{
typename graph_traits<Graph>::vertex_descr... | ALGO | 0.999159 | 6.355804 |
a2c628ed-943b-4057-8b01-f7c785b4d514 | zhouyong1234/SLAM-All-In-One | VIO系列/svo_edgelet/src/feature_alignment.cpp | #ifdef __SSE2__
#include <emmintrin.h>
#endif
#ifdef __ARM_NEON__
#include <arm_neon.h>
#endif
#include <cmath>
#include <svo/feature_alignment.h>
namespace svo {
namespace feature_alignment {
#define SUBPIX_VERBOSE 0
bool align1D(
const cv::Mat& cur_img,
const Vector2f& dir, // direction in... | ALGO | 0.998883 | 5.767791 |
231136ce-12b2-4043-a662-8d8e0f673f5c | EagleEyeKestrel/Leetcode | 1401-1500/1420. 生成数组/O(nkm).cpp | class Solution {
public:
int numOfArrays(int n, int m, int k) {
long long mod = 1e9 + 7, res = 0;
long long dp[n][k + 1][m + 1], s[n][k + 1][m + 1];
//dp[i][j][l] = dp[i-1][j-1][1] + ... + dp[i-1][j-1][l-1]
//dp[i][j][l] = l*dp[i-1][j][l]
memset(dp, 0, sizeof(dp));
me... | ALGO | 0.999993 | 5.092692 |
60123e40-ffdb-4917-912f-72da60cabdeb | mattjr/structured | vcgapps/OGF/cells/map_algos/iso_curves_extractor.cpp | #include <OGF/cells/map_algos/iso_curves_extractor.h>
#include <OGF/cells/map/geometry.h>
#include <algorithm>
namespace OGF {
GraphInMap::GraphInMap(Map* map, Graph* graph) {
map_ = map ;
graph_ = graph ;
vertices_in_edge_.bind(map_) ;
vertex_in_vertex_.bind(map_) ;
embedd... | ALGO | 0.961953 | 7.473105 |
ef67d090-6526-4444-9ada-b29f73d50147 | Wave-Project/frameworks_av | media/libeffects/lvm/lib/Common/src/MixSoft_1St_D32C31_WRA.cpp | /**********************************************************************************
INCLUDE FILES
***********************************************************************************/
#include "Mixer_private.h"
#include "VectorArithmetic.h"
/**************************************************************************... | ALGO | 0.99803 | 4.376318 |
f10b22a0-23ab-4637-ae51-14d5db54afeb | 05hiteshbansal/leetcodesolution | Longest-Nice-Subarray.cpp | class Solution {
public:
int longestNiceSubarray(vector<int>& nums) {
int n=nums.size();
int i=0;
int j=0;
int ans=0;
int temp=0;
int sub=0;
while(i<n){
while((nums[i]&temp)!=0){
temp^=nums[j];
j++;
s... | ALGO | 0.999993 | 5.63459 |
ccf7cb3a-e057-4ed4-8397-97156248695b | quas-modo/Luogu | leetcode/0407/100244.cpp | #include<bits/stdc++.h>
#include<vector>
using namespace std;
class Solution {
public:
int ufs[100005];
int ans[100005];
void merge(int a, int b) {
int fa = get(a);
int fb = get(b);
if (fa != fb) {
ufs[fa] = fb;
}
}
int get(int x) {
return ufs[x] ... | ALGO | 0.999837 | 5.368931 |
50732a9f-8095-422e-9335-83413b648801 | davidmallasen/GameOfLife_sparse | src/game_of_life.cpp | #include <game_of_life.h>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <boost/unordered_map.hpp>
GameOfLife::GameOfLife() {
//
}
void GameOfLife::step() {
population_t prev_population;
boost::unordered_map<cell_t, int> density;
prev_population.swap(population_);
// Compute... | ALGO | 0.991046 | 5.497225 |
b3a0d1b6-3949-4f2a-9380-e3d5f535ec50 | Amankapil/DSA | LinkedList/linked1.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *next;
node(int val)
{
data = val;
next = NULL;
}
};
void insertAtHead(node *&head, int val)
{
node *n = new node(val);
n->next = head;
head = n;
}
void insertAtTail(node *&head, int val)... | ALGO | 0.999961 | 4.767242 |
7f87935d-805e-46fe-9d48-f348f98918f0 | kratikesh18/MyDSA | 18_Dynamic Programming/Q8_NumberOfDiceRollsWithTargetSum.cpp | #include<iostream>
#include<vector>
using namespace std;
// Declaring the Mod value ie 10 ^ 9 +7 = 1000000007;
long long int Mod = 1000000007;
int AnsUsingMemoisation(int n , int k , int target , vector<vector<int> > &dp){
if(n ==0 && target == 0){
return 1;
}
if( n != 0 && target ==0){
... | ALGO | 0.99999 | 4.751851 |
e3f5a532-c9c5-4472-a894-958414d88c2d | windrew/Baekjoon_ac_codes | 11659.cpp | #include <stdio.h>
int a[100005],p[100005];
int main()
{
int i,n,m;
scanf("%d %d",&n,&m);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
p[i] = p[i-1] + a[i];
}
for(i=1;i<=m;i++)
{
int b,c;
scanf("%d %d",&b,&c);
printf("%d\n",p[c]-p[b-1]);
}
} | ALGO | 0.999922 | 3.653616 |
062069fa-dfc1-4d84-a573-276c276d33de | shoaibrayeen/Programmers-Community | Data Structure/Matrix/Print A Given Matrix in Spiral Form/SolutionByAnuj.cpp | #include <iostream>
using namespace std;
void spiralPrint(int input[][1000], int row, int col)
{
int row_min = 0, col_min = 0, row_max = row - 1, col_max = col - 1;
int counter = 0;
while (counter < (row * col)) {
for (int i = row_min, j = col_min; j <= col_max && counter < (row * col); j++) {
... | ALGO | 0.999931 | 3.897953 |
44db46e5-7197-4aa4-b50e-8b99542d84fa | ishandutta2007/codeforces | robezh/normal/1037/F.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 500, mod = (int)1e9 + 7;
typedef long long ll;
typedef pair<int, int> P;
int n,k;
P num[N];
ll sum[N];
bool cmp(P p1, P p2){
return p1.first != p2.first ? p1.first > p2.first : p1.second > p2.second;
}
int main(){
scanf("%d%d", &n, &k);
... | ALGO | 0.999964 | 4.09821 |
f1e1a65b-de6c-40c7-989c-e668906a1072 | Jonahowns/oxpy_anm | src/Observables/PlectonemePosition.cpp | /*
* DenaturationPattern.cpp
*
* Created on: Aug 19, 2013
* Author: matek
*/
#include "PlectonemePosition.h"
#include "../Interactions/DNAInteraction.h"
#include "../Utilities/OrderParameters.h"
PlectonemePosition::PlectonemePosition() {
_critical_bp_distance = 40;
_critical_strand_distance = 8.5;
_midp... | TOOL | 0.986521 | 4.602775 |
b802ed3a-e9d8-4d64-8fab-0973eacb4a0d | subodhnarayan/100DayofCoding | day44.cpp | // Padovan Sequence
// EasyAccuracy: 34.96%Submissions: 49K+Points: 2
// Solve today's problem-> Be the comment of the day-> Win a GfG T-Shirt!
// Daily rewards up for grabs!
// banner
// Given a number n, find the nth number in the Padovan Sequence.
// A Padovan Sequence is a sequence which is represented by the fol... | ALGO | 0.999988 | 5.669276 |
dd0e4cc8-0cfd-418d-9def-9bc3a778d783 | burakunaltay/hackerrank-solutions | contests/strangecounter.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
unsigned long long input = 0;//it is less then 10^12 so may int is enough ?
std::cin>>input;
unsigne... | ALGO | 0.99999 | 4.020791 |
79cd6d72-2acb-4d6d-a457-8942f52e41df | softarts/myoj | ojcpp3/0523_contsubarrsum.cpp | #include <vector>
// yitu
// count, 输入 int 类型数组, 假设每个数都是正整数。
// nums[i] <= 1000, size(nums) <= 10000
// return int, 表示 多少个子串,序列和,是 7的倍数。
// 3, 6, 7, 1, 2, 7
// [7], [6, 7, 1], [7], return 3, 连续的
// 是否存在子串,和是k的整数倍
// 能否只用O(N)做到
// input: nums = [23,2,4,6,7], k = 6
// Output: true
// Explanation: [2, 4] is a continuou... | ALGO | 0.999592 | 5.48204 |
789fb02d-9639-4340-973f-7a0ae02d393c | Arkaprabha13/Dsa | strings.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str="geeksforgeeks";
int count[26]={0};
for(int i=0;i<str.length();i++){
count[str[i]-'a']++;
}
for(int i=0;i<26;i++){
if(count[i]>0){
cout<<char(i+'a')<<" "<<count[i]<<endl;
}
}
} | ALGO | 0.999616 | 3.532141 |
d8672d0b-5378-48ba-9464-01379fb98b6e | MohmaedSobhy/Bookly-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.9988 | 6.76073 |
953657af-9e6f-41ed-b722-39b453179976 | zakijoho/AOJ-ICPC | 2600.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,h,w;cin>>n>>w>>h;
int tate[200010]={0},yoko[200010]={0};
for(int i=0;i<n;i++){
int x,y,wi;cin>>x>>y>>wi;
tate[max(y-wi,0)]++;tate[min(h+1,y+wi)]--;
yoko[max(x-wi,0)]++;yoko[min(w+1,x+wi)]--;... | ALGO | 0.999936 | 3.916979 |
05dfcf06-cd57-41d1-9bd0-7fc0d8b0bceb | ishandutta2007/codeforces | ei133333/normal/615/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int N, M;
cin >> N >> M;
bool light[100] = {};
for(int i = 0; i < N; i++) {
int K;
cin >> K;
while(K--) {
int Y;
cin >> Y;
light[--Y] = true;
}
}
if(count(light, light + M, true) == M) {
cout << "YES" << en... | ALGO | 0.99997 | 3.656502 |
765f7638-1312-4cc1-903b-765816aa129d | ganeshskudva/Algorithms | Leetcode/Easy/L7.cpp | // 7. Reverse Integer
class Solution {
public:
int reverse(int x) {
if(x == INT_MIN) return 0;
int ret = 0;
bool flag = x < 0;
x = flag ? -x : x;
while(x > 0) {
if(INT_MAX / 10 < ret) return 0;
ret = ret * 10 + (x % 10);
x /= 10;
}
... | ALGO | 0.999901 | 5.778214 |
e628c4b9-19f8-48a7-b456-0bcd5a8538f4 | lordjuacs/compe | contest6/pE.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
// freopen("input.txt", "r", stdin);
/// bibliografia: guide to competitive programming
/*
revisar:
getline() ///hay distintos parametros aqui.
*/
m... | ALGO | 0.999805 | 4.323456 |
6f773c0f-832c-4784-83a3-cac57e770b85 | SamkitSanghvi/Coding | Number Theorey/Bit Manipulation/Reset_ith_bit.cpp | // KK
// Reset the ith bit (reset means to make it 0) Use and with 0
// 1 0 1 0 1 1 0
// 1 1 0 1 1 1 1 -> to find mask
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
cout << n && (~(1<<k-1));
return 0;
}
| ALGO | 0.999758 | 3.648489 |
a5e8bd09-54eb-4a8d-931e-6add5d2ce9f3 | yeohj0710/old-solutions | 14000s/14264.cpp | #include<stdio.h>
#include<math.h>
int main() {
double L;
scanf("%lf", &L);
printf("%.10lf", (L/2)*(L/2*sqrt(3)));
}
| ALGO | 0.998946 | 3.481823 |
0bc61207-3abe-4098-bb9b-c7d892822472 | jacheima/Paradox_PathfindingTest | Pathfinding_ParadoxInt/Pathfinding_ParadoxInt/Source1.cpp | #include <iostream>
#include <list>
#include <set>
#include <vector>
#include <chrono>
#include <math.h>
#include <string>
#define INF 10000000
using namespace std;
using namespace std::chrono;
//the number of node in the map
int numberOfNodes;
//pointer to the adjacent nodes list
list<pair<int, int>>* adjacentNode... | ALGO | 0.9989 | 4.054265 |
30c84706-fad7-4010-93fb-09387f076301 | RafaMatesco/1ano-bimestre3 | Alberson/lista Vetor/EX C.cpp | #include <stdio.h>
int matriz[4][5];
int matrizb[4][5];
int matrizc[4][5];
int x;
int y;
int cont;
main(){
for(x=0; x<=3; x++){
for(y=0; y<=4; y++){
printf("digite o numero da matriz A na linha %d e coluna %d: ", x, y);
scanf("%d", &matriz[x][y]);
}
}
printf("\n===============================================... | ALGO | 0.999349 | 3.094788 |
454aee93-52a9-4df3-a88c-ebde8b2e7781 | yifancui1/Solar-system | eigen/doc/examples/class_FixedBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::Block<Derived, 2, 2>
topLeft2x2Corner(MatrixBase<Derived>& m)
{
return Eigen::Block<Derived, 2, 2>(m.derived(), 0, 0);
}
template<typename Derived>
const Eigen::Block<const Derived, 2, 2>
topLeft2... | TOOL | 0.878996 | 6.64346 |
e1cf88bc-f1e8-49a5-b0a6-70114feb5d3a | tenshoukijp/nobu7_mod_base_mod | src/将星録.mod/usr_custom_mod.cpp | /*
// DLL̃pXw
System::String^ dllPath = "JX^mod.dll";
// DLL[h
System::Reflection::Assembly^ assembly = System::Reflection::Assembly::LoadFrom(dllPath);
// ÓINXTypeIuWFNg擾i"Namespace.ClassName"Ŏwj
Type^ type = assembly->GetType("JX^mod");
// ÓI\bhMethodInfoIuWFNg擾
System::Reflection::... | TOOL | 0.913646 | 5.591833 |
bfff2ba4-70f4-40bd-9fd2-02c581432e06 | alexandraback/datacollection | solutions_5738606668808192_1/C++/iriszero/main.cpp | #include <stdio.h>
#include <vector>
#include <assert.h>
using namespace std;
long long int lld_pow(int n, int r) {
long long ret = 1;
while(r--) {
ret *= n;
}
return ret;
}
int main(void) {
freopen("output.txt", "w", stdout);
const int N= 32; const int J= 500;
printf("Case #%d:\n... | ALGO | 0.999854 | 3.338516 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.