text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; inline char gc() { static char buf[1 << 16], *S, *T; if (S == T) { T = (S = buf) + fread(buf, 1, 1 << 16, stdin); if (T == S) return EOF; } return *S++; } inline long long read() { long long x = 0, f = 1; char ch = gc(); while... |
#include <bits/stdc++.h> using namespace std; const int32_t mod = 1e9 + 7; const long long inf = 1e18; set<long long> S; void doq() { for (long long i = 0; i < 40; i++) { for (long long j = 0; j < 40; j++) { long long a = 3 * i + 7 * j; if (a <= 100) S.insert(a); } } } ... |
#include <bits/stdc++.h> using namespace std; const long long N = 1e6 + 9; long long n, k; long long a[N]; long long ans; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cerr << ; cin >> n >> k; for (int i = 0; i < (n); i++) cin >> a[i], a[i]--; sort(a, a + n, greater<l... |
#include <bits/stdc++.h> using namespace std; long long GCD(long long u, long long v) { long long r; while (v) { r = u % v; u = v; v = r; } return u; } long long modpow(long long a, long long p, long long mod) { long long ret = 1; while (p) { if (p & 1) ret = (ret... |
#include <bits/stdc++.h> using namespace std; long long a[2500000]; int main() { int all; scanf( %d , &all); for (int i = 1; i <= all; i++) { scanf( %I64d , &a[i]); } sort(a + 1, a + all + 1); reverse(a + 1, a + all + 1); long long sum = 0; for (int fro = 1; fro <= all; fro =... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); double s, x, y, z; cin >> s >> x >> y >> z; if ((x == y) && (y == z) && (z == 0.0)) { cout << 0 0 << s << endl; return 0; } double k = x + y + z,... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; int vis[2000007]; string s; int main() { int n, k, i, j, l, x, len = 0, pos; string in; cin >> n; for (i = 0; i < 2000007; i++) s += a ; for (i = 0; i < n; i++) { cin >> in >> k; pos = -(int)in.length(); for (j = 1; j <= k; j++... |
#include <bits/stdc++.h> using namespace std; int a[100005]; bool vis1[100005], vis2[100005]; vector<int> e1[100005], e2[100005]; queue<int> q1, q2; int main() { int n, m; scanf( %d%d , &n, &m); for (int i = 1; i <= n; i++) scanf( %d , &a[i]); for (int i = 1; i <= m; i++) { int x, y; ... |
#include <bits/stdc++.h> using namespace std; #define INF 1000000009 int get(int i){ cout << ? << i+1 << endl; cout.flush(); int a; cin >> a; int b; if(i == 0) b = INF; else{ cout << ? << i << endl; cout.flush(); cin >> b; } re... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int mod2 = 1e9 + 9; const int maxN = 5e5 + 100; const int INF = 1e9 + 7; const int maxedge = 1e6 + 100; const long long LL_INF = 1e18 + 11; using namespace std; long long n, ans; map<long long, long long> ma; void file() ... |
/*
Copyright (c) 2021 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute,... |
#include <bits/stdc++.h> using namespace std; long long int powerMod(long long int x, unsigned long long int y) { if (y == 0) return 1; long long int p = powerMod(x, y / 2) % 1000000007; p = (p * p) % 1000000007; return (y % 2 == 0) ? p : (x * p) % 1000000007; } long long int power(long long int... |
#include <bits/stdc++.h> using namespace std; const long long N = 200000 + 10; const long long M = 1000000 + 10; const long long INF = (long long)1e9 + 10; long long n, m; long long tl[N], tr[N]; map<long long, long long> toX; pair<long long, long long> a[N]; pair<pair<long long, long long>, pair<long... |
#include <bits/stdc++.h> using namespace std; int n, m; int main() { scanf( %d %d , &n, &m); if (m > n) { printf( -1 ); return 0; } m -= 2; if (n == 1) { printf( a ); return 0; } if (n > 1 && m < 0) { printf( -1 ); return 0; } for (int i = 1;... |
#include <bits/stdc++.h> using namespace std; const int N = 1e3 + 5; bool isPrime[N], vst[N]; int frq[26]; vector<int> adj[N]; vector<int> cc; vector<vector<int>> vcc; void dfs(int u) { cc.push_back(u); vst[u] = 1; for (auto v : adj[u]) { if (!vst[v]) dfs(v); } } bool cmp(vecto... |
//-----------------------------------------------------------------------------
// File : clock_generator.v
// Creation date : 26.04.2017
// Creation time : 16:30:51
// Description : A clock source for simulations. Will also assert and deassert reset and terminate the simulation after WAIT_TIME has passed si... |
#include <bits/stdc++.h> using namespace std; int n, m; int l[100500]; int r[100500]; int val[100500]; int t[400500]; int t2[400500]; int mas[100500]; int INF = 0; void build(int v, int tl, int tr) { if (tl == tr) t[v] = 0; else { int mid = (tl + tr) >> 1; build(v << 1, tl,... |
//
// Copyright (c) 1999 Steven Wilson ()
//
// This source code is free software; you can redistribute it
// and/or modify it in source code form under the terms of the GNU
// General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option)
// ... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2019 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
// verilator lint_off WIDTH
typedef enum logic[2:0] {P=0, W=1'b1, E, N, S} Dirs;
typede... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:102400000,102400000 ) using namespace std; int n, m, ans, flag; bool vis[10]; string fac[7] = { 1869 , 1968 , 1689 , 6198 , 8691 , 8916 , 1896 }; string s, ss, anss, xx = 0000 ; int main() { int i, j, t, pos, x, y, u, v, w; while (cin... |
/**
* This is written by Zhiyang Ong
* for EE577b Extra Credit Homework , Question 2
*
* Behavioral model for the Hamming encoder
*/
module ham_15_11_encoder (d,c);
// Output signals representing the 15-bit encoded vector
output reg [14:0] c;
// Input signals representing the 11-bit input
input [10:0] d;
... |
// ZX-Evo Base Configuration (c) NedoPC 2008,2009,2010,2011,2012,2013,2014
//
// generates horizontal vga sync, double the rate of TV horizontal sync
/*
This file is part of ZX-Evo Base Configuration firmware.
ZX-Evo Base Configuration firmware is free software:
you can redistribute it and/or modi... |
/*
* Copyright 2018-2022 F4PGA Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... |
`include "bsg_defines.v"
`include "bsg_noc_links.vh"
`include "bsg_wormhole_router.vh"
module bsg_wormhole_router
import bsg_wormhole_router_pkg::StrictXY;
import bsg_wormhole_router_pkg::StrictX;
#(parameter `BSG_INV_PARAM(flit_width_p)
,parameter dims_p = 2 // 1
,parameter dirs_lp ... |
// ----------------------------------------------------------------------
// Copyright (c) 2015, The Regents of the University of California All
// rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, a, b; cin >> n >> a >> b; vector<int> c(n); for (int i = 0; i < n; ++i) { cin >> c[i]; } int i = 0, j = n - 1; int ans = 0; while (i < j) { if (c[i] ==... |
#include <bits/stdc++.h> using namespace std; int n, k; long long s[211111], mx[211111]; int a[211111], bg[211111]; long long hf, ans; int bhf, aa, bb; int main() { scanf( %d%d , &n, &k); for (int i = 1; i <= n; ++i) { scanf( %d , &a[i]); s[i] = s[i - 1] + a[i]; } for (int i = ... |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2011 Xilinx, Inc.
// All Right Reserved.
///////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor : Xilinx
// \ \ \/ Version : 13.... |
/*
Copyright (c) 2019 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute,... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016
// Date : Mon Jun 05 17:25:05 2017
// Host : GILAMONSTER running 64-bit major release (... |
//[Disclaimer] Integrated Silicon Solutions Inc. ("ISSI") hereby grants the
// user of this model a non-exclusive, nontransferable
// license to use this model under the following terms.
// The user is granted this license only to use the model
// and is not granted rights to sell, copy (except as needed to
// run... |
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const long long LINF = 0x3f3f3f3f3f3f3f3fll; int main() { int n, k; scanf( %d , &n), scanf( %d , &k); if (k % 2 == 0) { int ans = 0; while (n--) { int x; scanf( %d , &x); if (x == 1) ans ^= ... |
/*
Copyright (c) 2014 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute,... |
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 2, M = 6e5 + 2, O = 1.2e6 + 2; long long len1[M], len2[M], v[N], g[N][4], ans[M]; long long lx, ly; int lj[M], nxt[M], fir[N], f[N], qlj[O], qnxt[O], qfir[N], xw[O][3]; int flj[M], fnxt[M], ffir[N]; int n, q, i, x, y, c, bs, qs, fs; bool ... |
#include <bits/stdc++.h> using namespace std; inline char getc() { static char buf[1 << 20], *p1 = buf, *p2 = buf; return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2) ? EOF : *p1++; } template <typename T> void rd(T& x) { int f = 0, c; wh... |
module ADD_SUB(A, B, value_result_tens, value_result_units, sign_result, KEY_IN, clk, reset_n, operator);
output [3:0] value_result_tens;
output [3:0] value_result_units;
output [3:0] A;
output [3:0] B;
output sign_result;
input [1:0] operator;
input [3:0] KEY_IN;
input reset_n;
input clk;
/*
reg ... |
#include <bits/stdc++.h> using namespace std; int a[100100]; int main() { int i, n; scanf( %d , &n); for (i = 0; i < n; i++) scanf( %d , &a[i]); sort(a, a + n); int sign = 1; for (i = 0; i < n; i++) { if (a[i] >= sign) { a[i] = sign; sign++; } } printf( ... |
#include <bits/stdc++.h> using namespace std; int main() { int b, w; cin >> w >> b; if (w == 0) cout << 0.000000000 << endl; else if (b == 0) cout << 1.000000000 << endl; else if (b == 1) printf( %.9f n , double(w) / (w + 1)); else if (b == 2) printf( %.9f n , dou... |
#include <bits/stdc++.h> using namespace std; struct ln { long long m, k; ln(long long mm, long long kk) { m = mm; k = kk; } }; deque<ln> cvt; long long dp[100010][2]; long long sw[100010]; long long wt[100010]; long long hilldist[100010]; long long cs(long long x, int ci) { re... |
#include <bits/stdc++.h> using namespace std; vector<vector<int> > data; vector<bool> used; vector<int> cycle; void dfs(int vertex, int last, vector<int> &path) { used[vertex] = true; path.push_back(vertex); for (int i = 0; i < data[vertex].size(); ++i) { int to = data[vertex][i]; if (... |
/******************************************************************************
This Source Code Form is subject to the terms of the
Open Hardware Description License, v. 1.0. If a copy
of the OHDL was not distributed with this file, You
can obtain one at http://juliusbaxter.net/ohdl/ohdl.txt
Description: Saturat... |
#include <bits/stdc++.h> using namespace std; long long mod(long long v, long long k, long long p) { long long res = 1; for (long long i = 0; i < 4; i++) res *= v, res %= p; res -= ((k * v) % p); if (res < 0) res += p; return res; } int main() { ios_base::sync_with_stdio(false); cin.... |
// megafunction wizard: %ROM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: two_new2.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ===============================... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
//////////////////////////////////////////////////////////////////////
//// ////
//// OR1200's Write-back Mux ////
//// ////
//// This file is part of the OpenR... |
/*
*
* Copyright (c) 2011-2012
*
*
*
* 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 Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// $Id: c_select_mofn.v 5188 2012-08-30 00:31:31Z dub $
/*
Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution... |
#include <bits/stdc++.h> using namespace std; int n, M[2002][2002]; bool V[2002]; vector<int> L, L_; void dfs(int inicial, vector<int> &Li) { Li.push_back(inicial); V[inicial] = 1; for (int i = 0; i < n; ++i) if (!V[i] && M[inicial][i]) dfs(i, Li); } bool Conexo() { dfs(0, L); fo... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 13:06:52 06/28/2009
// Design Name:
// Module Name: dcm
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// R... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const long long maxm = 2e5 + 5; vector<long long> g[maxm]; long long mark[maxm]; long long p[maxm]; long long c[maxm]; long long ans; long long n; void solve(long long x) { vector<long long> s; while (!mark[x]) { s.push_back(x); mark[x]... |
#include <bits/stdc++.h> using namespace std; char _buf[100000], *_p1 = _buf, *_p2 = _buf; inline int gi() { int x = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = (x << 3) + (x << 1)... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k, cnt = INT_MAX, c = 0; cin >> n >> k; string s, temp = ; cin >> s; int freq[26]; memset(freq, 0, sizeof(freq)); for (int i = 0; i < n; i++) freq[s[i] - A ]++; for (int i = 0; i < k; i++) { if (!freq[i]) retu... |
// bsg_nonsynth_clock_gen_plusarg
//
// This module is a basic non-synthesizable clock generator. This module is
// designed to be used with VCS and can be changed at runtime rather than
// compile time. To set the speed of the clock, add the following flag when
// executing the simulation binary:
//
// ./simv +cloc... |
#include <bits/stdc++.h> const int MAXN = 100010, inf = 2147483233; using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == - ) f = -1; ch = getchar(); } while (isdigit(ch)) { x = x * 10 + ch - 0 ; ch = getchar(... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 13:49:19 05/27/2016
// Design Name:
// Module Name: prueba_lectura_rtc
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependenc... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; vector<int> g[300005]; int cnt[300005]; int vis[300005]; int ans[300001][26]; int res = 0; int main() { queue<int> q; int n, m; cin >> n >> m; string s; cin >> s; int x, y; while (m--) { scanf( %d%d , &x, &y); x--, y--; ... |
#include <bits/stdc++.h> using namespace std; int gr[1005][1005], n, m, a[1005], x, y; long long g[1005]; bool vis[1005]; int main() { scanf( %d , &n), scanf( %d , &m); for (int i = 1; i <= n; i++) { scanf( %d , &a[i]); } int mi = 100000100, l1 = 0; int ans = 0; for (int i = 0; i... |
/*
File: fifo_mem.v
This file is part of the Parallella FPGA Reference Design.
Copyright (C) 2013 Adapteva, Inc.
Contributed by Roman Trogan <>
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 Free Software Fo... |
#include <bits/stdc++.h> using namespace std; const int MAX = 205; const int INF = 0x3f3f3f3f; string a, b; int dp[MAX][MAX][405]; int call(int x, int y, int s) { if (x >= a.size() and y >= b.size()) return s; if (dp[x][y][s] != -1) return dp[x][y][s]; int ret = INF; if (x < a.size() and y <... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; const int M = 1e6 + 10; const long long INF = 0x3f3f3f3f3f3f3f; const int inf = 0x3f3f3f; const double esp = 1e-6; long long read() { long long x = 0; long long k = 1; char c = getchar(); while (c < 0 || c > 9 ) { ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, i, j, r = 1; cin >> n; int a[n][n]; for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (i % 2 == 0) { a[i][j] = r; r++;... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x = n / 2, y = (n / 2) + 1, prime1 = 0, prime2 = 0; if (n % 2 == 0) { x = (n / 2); y = n / 2; } for (int i = 1; i <= n; i++) { for (int j = 2; j < x; j++) { if (x % j == 0) { p... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; const int N = 3e5 + 3; const int mod = 1e9 + 7; int n; ll a[N]; template <class T> struct FT { vector<T> tree; int sz; FT(int n) { sz = n, tree.resize(n + 1); } T g... |
`timescale 1 ns / 100 ps
module bench
(
);
reg clk;
reg rst;
// ORLINK interface
reg ifclk_in;
reg fifoData_wr;
reg [7:0] fifoData_out;
wire [7:0] fifoData_io;
reg gotData_in;
reg gotRoom_in;
output sloe_out;
output slrd_out;
output slwr_out;
output [1:0] fifoAddr_out;
output pktE... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k, i, j; while (~scanf( %d%d , &n, &k)) { if (n <= 2 * k) { printf( -1 n ); continue; } else { printf( %d n , n * k); for (i = 1; i <= n; i++) { for (j = 1; j <= k; j++) { if (... |
#include <bits/stdc++.h> using namespace std; const long long MAXN = 2e5 + 5; const long long MOD = 1e9 + 7; const long long INF = 1e18; mt19937 rnd(time(0)); signed main() { long long q; cin >> q; while (q--) { long long d, mod; cin >> d >> mod; long long c = 1; long lon... |
/*******************************************************************************
* *
* Copyright (C) 2009 Altera Corporation *
* ... |
#include <bits/stdc++.h> using namespace std; int main() { long long k, m = 9, x; long long r = 1, n, j, d = 0; cin >> k; while (k - m * r > 0) { k -= m * r; ++r; m = m * 10; } n = (k - 1) / r; j = (k - 1) % r; x = pow(10, r - 1) + n; for (long i = 0; i < r - j ... |
#include <bits/stdc++.h> using namespace std; template <class X> void temfunc(const X a) { for (auto it = a.begin(); it != a.end(); it++) cout << *it << ; cout << n ; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ; int t, l, r; cin >> t; while (t--) { ... |
#include <bits/stdc++.h> using namespace std; int n, a[301][301], dp[301][301][301]; int solve(int i, int j, int k) { if (i == n && j == n && k == 0) return a[n][n]; int x = i + k, y = j - k; if (x < 1 || y < 1 || x > n || y > n || i < 1 || j < 1 || i > n || j > n || k < 0) return -1e9; ... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long x1, y1, z1; long long x2, y2, z2; cin >> x1 >> y1 >> z1; cin >> x2 >> y2 >> z2; long long sum = 0; if (z2 > x1) { z2 -= x1; if (z2 > z1) { z2 ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 16:04:06 03/25/2011
// Design Name:
// Module Name: debounce
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Depend... |
// megafunction wizard: %FIFO%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: scfifo
// ============================================================
// File Name: FIFO_SUM_IN_SQUARED.v
// Megafunction Name(s):
// scfifo
//
// Simulation Library Files(s):
// altera_mf
// ===============================... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2014.1
// Copyright (C) 2014 Xilinx Inc. All rights reserved.
//
// ==============================================================
`timescale 1 ns / 1 ps
mod... |
/*
*
* Copyright (c) 2011
*
*
*
* 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 Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the ... |
//#####################################################################
//# This module converts the packet interface to a 64bit wide format
//# suitable for sending out to a parallel to serial shift register.
//# The frame signal is sent along together with the data making.
//# The goal is to minimize the amount of l... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/*******************************************************************
Company: UNSW
Original Author: Lingkan Gong
Project Name: XDRS
Create Date: 19/09/2010
Design Name: maximum
*******************************************************************/
`timescale 1ns/1ns
module maximum
#(parameter
C_CNT_BW =... |
//Legal Notice: (C)2017 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associate... |
// -------------------------------------------------------------
//
// File Name: hdl_prj\hdlsrc\controllerPeripheralHdlAdi\Update_Count_From_AB.v
// Created: 2014-09-08 14:12:09
//
// Generated by MATLAB 8.2 and HDL Coder 3.3
//
// -------------------------------------------------------------
// -----------------... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const int INF = 1061109567; const int MAXN = 510005; int dp[MAXN]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(20); int n, d; cin >> n >> d; memset(dp, 0, sizeof dp); dp[0] = 1; int items[n]; ... |
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) #pragma GCC target( avx,avx2,fma ) using namespace std; long long seg[5000000]; long long scn[5000000]; void update(long long pos, long long x, long long l = 0, long long r = 300000, long long ind = 1) { if (l == r && l == pos) s... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// file: MIPS_CPU_clk_wiz_0_0.v
//
// (c) Copyright 2008 - 2013 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaime... |
#include <bits/stdc++.h> using namespace std; int main() { long long int t, n, d, x, y, javab1, javab2, ans[1000]; cin >> t; for (int i = 0; i < t; i++) { cin >> n >> x >> y >> d; javab1 = javab2 = n; if ((y - x) % d == 0) { ans[i] = ((abs(y - x)) / d); } else if ((y - 1)... |
module avlst_n_to_1 #(
parameter N = 8,
parameter DATA_W = 16,
)(
input csi_clk,
input rsi_reset,
output asi_ready,
input asi_valid,
input [N*DATA_W-1:0] asi_data,
input aso_ready,
output aso_valid,
output [DATA_W-1:0] aso_data
... |
/* SPDX-License-Identifier: MIT */
/* (c) Copyright 2018 David M. Koltak, all rights reserved. */
/*
* rcn bus master and slave (combined) interface - one cycle read delay.
*
*/
module rcn_master_slave
(
input rst,
input clk,
input [68:0] rcn_in,
output [68:0] rcn_out,
input cs,
input [1:... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 100005; int n, S = 0; char x[2], s[MAXN]; int viv[MAXN]; bool use[MAXN]; int cqf() { int l = -1, r = -1; int ans = MAXN, sum = 0; while (true) { while (r <= n && sum < S) { r++; if (!viv[s[r]] && use[s[r]]) su... |
/***********************************************
Module Name: CORDIC_sqrt_test
Feature: Testbench for CORDIC (mode 3)
An example for the GEM Projects
Coder: Garfield
Organization: XXXX Group, Department of Architecture
------------------------------------------------------
Variables:
... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 10; const int maxm = 1e5 + 10; const int INF = 0x3f3f3f3f; const long long LINF = 3e17 + 1; const int mod = 998244353; int n, m, eid, sz; inline int read() { register int x = 0, f = 1; char ch = getchar(); while (!isdigit(c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.