text
stringlengths
59
71.4k
(** * Extraction: Extracting ML from Coq *) (** * Basic Extraction *) (** In its simplest form, extracting an efficient program from one written in Coq is completely straightforward. First we say what language we want to extract into. Options are OCaml (the most mature), Haskell (which mostly works), a...
/** * 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 (c) 2009 Xilinx Inc. // // 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...
/////////////////////////////////////////////////////////////////////////////// // // File name: axi_protocol_converter_v2_1_7_b2s_incr_cmd.v // /////////////////////////////////////////////////////////////////////////////// `timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module ax...
#include <bits/stdc++.h> using namespace std; int n, x, s, d, t, a, b, r[5000], l, res1, res2, k; int main() { cin >> n >> k; for (int i = 0; i < k; i++) { cin >> t; if (t == 1) { cin >> a >> b; r[a] = r[b] = 1; l += 2; } else { cin >> a; r[a] = 1;...
// ********************************************************************/ // Actel Corporation Proprietary and Confidential // Copyright 2009 Actel Corporation. All rights reserved. // // ANY USE OR REDISTRIBUTION IN PART OR IN WHOLE MUST BE HANDLED IN // ACCORDANCE WITH THE ACTEL LICENSE AGREEMENT AND MUST BE APPROVED...
// file: design_1_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; long long int a[500005], b[500005]; int main() { int i, j, k, l, x, y, z, m, n, t; cin >> t; while (t--) { cin >> x >> y >> z; while (x > 20 && y) { x = x / 2; x += 10; y--; } while (x >= 0 && z) { x ...
/* * 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 long long N = 3e5 + 3e4; long long lp[N], rp[N], l, r, first, second, m, so, k, n; char ch; int main() { cin >> n; for (long long i = (long long)1; i <= (long long)n; i++) { cin >> ch >> k; if (ch == ? ) { first = l - lp[k]; ...
/** * 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> inline int getint() { int x = 0, p = 1; char c = getchar(); while (c <= 32) c = getchar(); if (c == 45) p = -p, c = getchar(); while (c > 32) x = x * 10 + c - 48, c = getchar(); return x * p; } using namespace std; const int N = 110; const int M = 25; int dp[...
// Copyright 1986-2017 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2017.3 (win64) Build Wed Oct 4 19:58:22 MDT 2017 // Date : Fri Nov 17 14:53:08 2017 // Host : egk-pc running 64-bit major release (build...
/** * 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...
// Icarus 0.6 AND snapshot 20020728 // ----------------------------- // (1) force to nets not supported // (2) comment the force statement and the release statement will cause // the compiler to fail silently (no messages, no a.out) // // Icarus snapshot 20020817 // ------------------------ // Runs fine IFF...
/** * 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...
`define Z 0 `define N 1 `define C 2 `define V 3 module CU(input wire [31:0] instruction, input wire [3:0] flags, input wire clock, output reg PCSrc/*Done*/, output reg MemToReg/*Done*/, output reg MemWrite/*Done*/, output reg [1:0] ALUControl/*Done*/, output reg ALUSrc/*Done*/, output reg [1:0] ImmSrc/*Done*/...
/** * This is written by Zhiyang Ong * and Andrew Mattheisen */ `timescale 1ns/100ps /** * `timescale time_unit base / precision base * * -Specifies the time units and precision for delays: * -time_unit is the amount of time a delay of 1 represents. * The time unit must be 1 10 or 100 * -base is the time base...
/* * 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; template <int V, class T = long long> class max_flow { static const T INF = numeric_limits<T>::max(); struct edge { int t, rev; T cap, f; }; vector<edge> adj[V]; int dist[V]; int ptr[V]; bool bfs(int s, int t) { memset(dis...
#include <bits/stdc++.h> using namespace std; struct segment { int pos; int len; int type; }; struct segmentByLength { segment seg; bool operator<(segmentByLength o) const { segment seg2 = o.seg; if (seg.len != seg2.len) return seg.len > seg2.len; else { ret...
#include <bits/stdc++.h> const int mod = 1000000007; int dp[4][200005]; int main() { long long a, b; scanf( %I64d %I64d , &a, &b); long long t = sqrt(2 * (a + b)); while ((t * t + t > 2 * (a + b)) || ((t * t + 3 * t + 2) <= 2 * (a + b))) { --t; } long long sum = t * (t + 1) / 2; ...
#include <bits/stdc++.h> using namespace std; const long long INF = 1e18 + 123; const long double EPS = 1e-9; const int MX = 1e9 + 1; const int inf = 1e9 + 123; const int MOD = 1e9 + 7; const int N = 1e5 + 123; const int dx[] = {0, 0, 1, -1}; const int dy[] = {1, -1, 0, 0}; int n, m; long long dp[...
#include <bits/stdc++.h> typedef struct { char name[20]; char phone[200][20]; int len[200]; int avai[200]; int cnt, now; } friends; friends frd[20]; int total; int main() { int n; scanf( %d , &n); for (int i = 0; i < n; i++) { char tmp[20]; scanf( %s , tmp); i...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll llinf = (1ll << 61) - 1; const int inf = 1000000007; int TC = 1, CN, n, r, c[1 << 18 | 5]; signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); cout.precision(11), cout.setf(ios::fixed); auto...
#include <bits/stdc++.h> using namespace std; int mark[(10000000 >> 5) + 1]; void sieve() { register int i, j, k; (mark[1 >> 5] |= 1 << (1 & 31)); int n = 10000000; for (i = 2; i <= n; i++) { if (!(mark[i >> 5] >> (i & 31) & 1)) { for (k = n / i, j = i * k; k >= i; k--, j -= i) ...
`include "../network_params.h" module mult_adder_ctrl( input clock, input reset, input start, output [`X_COORD_BITWIDTH:0] x_coord, output [`Y_COORD_BITWIDTH:0] y_coord, output pixel_rdy // indicates valid data at end of tree/pipeline ); // wire declarations // reg declarations reg buffer_rdy; reg rdy...
`timescale 1ns / 1ps /* -- Module Name: Arbiter -- Description: Implementacion de algoritmo de arbitraje entre multiples peticiones. En particular este modulo implementa el algoritmo round-robin de 4 bits. Despues de un reset, el modulo da priorida en orden descendiente a las peticiones de: {PE, x+,...
#include <bits/stdc++.h> typedef long long ll; #define f(i,a,b) for(i=a;i<b;i++) using namespace std; int main() { ll n,i,sum=0, count=0; cin>>n; vector<ll> a(n); f(i,0,n) cin>>a[i]; priority_queue <int, vector<int>, greater<int>> p; f(i,0,n){ if(a[i]>=0) su...
#include <bits/stdc++.h> using namespace std; struct arra { long long int d = 0, idx; } arr[200008]; bool comp(struct arra a, struct arra b) { return a.d > b.d; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long n, k, a, temp, ans; cin >> n >> k; ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(); cout.tie(); int n; cin >> n; int arr[5001] = {0}; int ans = 0; for (int i = 0; i < n; i++) { int x; cin >> x; arr[x]++; } for (int i = 1; i <= n; i++) { ...
#include <bits/stdc++.h> using namespace std; const int N = 5005; template <class I> inline void ckMax(I& p, I q) { p = (p > q ? p : q); } template <class I> inline void ckMin(I& p, I q) { p = (p < q ? p : q); } template <class I> inline I Max(I& p, I q) { return p > q ? p : q; } tem...
/** * bsg_nonsynth_ramulator_hbm.v * */ `include "bsg_defines.v" module bsg_nonsynth_ramulator_hbm #(parameter `BSG_INV_PARAM(channel_addr_width_p) , parameter `BSG_INV_PARAM(data_width_p) , parameter `BSG_INV_PARAM(num_channels_p) , parameter debug_p=0 , parameter init_mem_p=0 // zero out val...
#include <bits/stdc++.h> using namespace std; const int len = 6020; int SIZE; const int inf = (int)1e9; int n; vector<int> in; vector<vector<int>> g; int flow[len][len], cost[len][len], pot[len]; int get_p(int u, int v) { return cost[u][v] + pot[u] - pot[v]; } int add_path(int from, int to) { ve...
#include <bits/stdc++.h> using namespace std; void sortLU(long long a[], long long n, long long b[]) { long long i, j; for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (a[i] < a[j]) { swap(a[i], a[j]); swap(b[i], b[j]); } } } } int main() { l...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; struct node { int x, p; } a[N]; int d, n, m, top, xx, nexttttt[N], last, q[N]; long long ans; bool cmp(node a, node b) { return a.x < b.x; } int main() { scanf( %d%d%d , &d, &n, &m); for (int i = 1; i <= m; i++) scanf( %d%...
#include <bits/stdc++.h> using namespace std; inline int read() { 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) + (ch ^ 48); ch = getchar(); } ...
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const int MOD = 1e9 + 7; vector<int> check(int n, vector<int> a, int x) { multiset<int> as; for (auto u : a) { as.insert(u); } vector<int> res; for (int i = 0; i < n; ++i)...
#include <bits/stdc++.h> using namespace std; const int maxn = 210, INF = 1 * 1000 * 1000 * 1000 + 10, maxm = 150, maxk = 10; int n, m, k, sar, now, par[maxn], x[maxk], c[maxn], d[maxn], f[maxn][maxn], dp[maxm][maxn], dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, -1, 1}, cur, X, Y, save; vec...
/** * 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...
#include <bits/stdc++.h> using namespace std; const int maxN = 50 + 10; long long dp[maxN]; int used[maxN]; int main() { int n; long long l; cin >> n >> l; dp[0] = 1; dp[1] = 1; for (int i = 2; i < maxN; i++) dp[i] = dp[i - 1] + dp[i - 2]; l--; for (int i = 0; i < n; i++) { ...
/** * 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; int main() { int k, n, s, p, b, c; cin >> k >> n >> s >> p; float a = (n * 1.0) / s; b = ceil(a); c = b * k; float d = (c * 1.0) / p; int t = ceil(d); cout << t; }
#include <bits/stdc++.h> using namespace std; long n, c[long(1e7 + 50)], cnt; void sieve() { c[1] = 1; for (long i = 2; i <= long(1e7); ++i) if (!c[i]) for (long j = 2; i * j <= long(1e7); ++j) c[i * j] = 1; } bool Prime(long x) { if (x < long(1e7)) { if (c[x]) return false; ...
// file: mmcm_mkid.v // // (c) Copyright 2008 - 2011 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 disclaimer is not a ...
//----------------------------------------------------------------------------- // // (c) Copyright 2010-2011 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 pro...
#include <bits/stdc++.h> using namespace std; int n, k; int query(int l, int r) { if (l < 1 || r > n) return false; string re; cout << 1 << << l << << r << endl; cin >> re; return re == TAK ; } int get(int l, int r) { if (l > r) return false; while (l < r) { int mid ...
// (C) 2001-2015 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 associated doc...
#include <bits/stdc++.h> using namespace std; const int maxN = 2e5 + 5; long long int a[maxN], b[maxN]; int n; void solve() { cin >> n; set<pair<long long int, int>> s; int count = n; for (int i = 0; i < n; i++) { b[i] = 1; cin >> a[i]; s.insert({a[i], i}); } while (!...
/** * 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 N = 2000; long long calcula(long long l, long long r, long long k) { long long d1 = -r; long long d2 = l - r; long long aum = d2 - d1; long long lim1 = d1; long long lim2 = d1 + (r * 1000000 - 1) * aum; if (lim1 <= k && k <= lim...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int T, n, m; int t1, t2; bool w; map<pair<int, long long>, int> mex; int solve(int rem = 60, long long msk = (1 << 60) - 1) { if (mex.count({rem, msk})) { return mex[{rem, msk}]; } mex[{rem, msk}] = 0; int x = 0; ...
#include <bits/stdc++.h> using namespace std; const int maxn = 2222, mod = 998244353; int add(int x, int y) { x += y; return x >= mod ? x - mod : x; } int mul(int x, int y) { return 1ll * x * y % mod; } int qpow(int a, int b) { int ans = 1; while (b) { if (b & 1) ans = mul(ans, a); ...
//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 : Tue Feb 14 01:36:24 2017 //Host : TheMosass-PC running 64-bit major release (buil...
// Copyright 1986-2017 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2017.3 (lin64) Build Wed Oct 4 19:58:07 MDT 2017 // Date : Tue Oct 17 15:19:42 2017 // Host : TacitMonolith running 64-bit Ubuntu 16.04.3...
// // 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) // ...
/* * 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 t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n); cout << 2 << endl; int prev = (n + n - 1) / 2; if ((n + n - 1) % 2 != 0) prev++; cout << n << << n - 1 << endl; for (int i = n ...
#include <bits/stdc++.h> using namespace std; template <class T> inline void gmin(T &x, const T &y) { x = x > y ? y : x; } template <class T> inline void gmax(T &x, const T &y) { x = x < y ? y : x; } template <class T> inline bool Gmin(T &x, const T &y) { return x > y ? x = y, 1 : 0; } ...
#include <bits/stdc++.h> inline int getint() { register char ch; while (!isdigit(ch = getchar())) ; register int x = ch ^ 0 ; while (isdigit(ch = getchar())) x = (((x << 2) + x) << 1) + (ch ^ 0 ); return x; } const long long mod = 1e9 + 7; const int N = 150001, M = 150002, K = 100001...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == 9 || s[i] == H || s[i] == Q ) { cout << YES ; return 0; } } cout << NO ; }
#include <bits/stdc++.h> using namespace std; int ans[1009]; int main() { memset(ans, -1, sizeof(ans)); for (int i = 1; i <= 15; i += 2) { int x = (i * i + 1) / 2; int y = (i - 1) / 4 * 2; for (int j = 0; j <= y; j++) { for (int k = 0; k <= (x - 1 - 2 * y) / 4; k++) { f...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: Jafet Chaves Barrantes // // Create Date: 12:44:02 05/14/2016 // Design Name: // Module Name: picture_hora // Project Name: // Target Devices: // Tool versions: // Description: ...
#include <bits/stdc++.h> using namespace std; long long u[11]; int main() { long long x, y, n, i, j, k = 0, l, arr[200009]; cin >> n; for (i = 0; i < n; i++) { cin >> arr[i]; } sort(arr, arr + n); for (i = 0, j = 1; i < n; i++) { if (arr[i] >= j) { k++; j++; ...
/* * 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; class ST { private: vector<long long> st; int n; int left(int p) { return p << 1; } int right(int p) { return left(p) + 1; } int query(int p, int L, int R, int i) { if (L > i) return 0; if (R <= i) return st[p]; return query(left...
/** * 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> int n, m; char map[1010][1010], ans[1010][1010]; int main() { scanf( %d%d , &n, &m); for (int i = 1; i <= n; i++) scanf( %s , map[i] + 1); for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) ans[i][j] = . ; for (int i = 1; i <= n; i++) for (int j = 1; j ...
// RX // Copyright 2010 University of Washington // License: http://creativecommons.org/licenses/by/3.0/ // 2008 Dan Yeager // RX module converts EPC Class 1 Gen 2 time domain protocol // to a serial binary data stream // Sample bitout on bitclk positive edges. // TR cal measurement provided for TX clock calibration...
// DESCRIPTION: Verilator: Verilog Test module module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc=0; reg [63:0] crc; reg [63:0] sum; // Take CRC data and apply to testblock inputs wire [9:0] in = crc[9:0]; /*AUTOWIRE*/ Test test (/*AUTOINST*/ // Inputs ...
/** * 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; int main() { long long n, m, k, u = 0, ans1 = 0, ans2 = 0; cin >> n >> m >> k; bool a[n][m]; long long sum[n + 2][m]; memset(sum, 0, sizeof(sum)); for (long long i = 0; i < n; i++) { for (long long j = 0; j < m; j++) { cin >> a[i][j...
#include <bits/stdc++.h> const long long max9 = 10 + 1e9, max6 = 10 + 1e6, max12 = 10 + 1e12, max15 = 10 + 1e15; const long long min6 = -1 * max6, min9 = -1 * max9, min12 = -1 * max12, min15 = -1 * max15; const long long R = 7 + 1e9, NN = 10 + 1e5; using namespace std; int ...
/** * 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...
//////////////////////////////////////////////////////////////////////////////// // // PS2-to-Kempston Mouse // (C) 2017 Sorgelig // // 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...
// // Copyright 2011 Ettus Research LLC // // 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 dis...
/* * 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...
/** * 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...
//Dummy tb for sound channel 4. //Tb is only for debug this module. `timescale 1ns / 1ps `include "aDefinitions.v" `include "collaterals.v" `include "SoundControllerChannel2.v" `include "SoundControllerOSC1.v" `include "SoundControllerOSC2.v" module tb; reg clk; wire clk64; wire clk256; wire clk131k; w...
/* * 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 dx[] = {0, 0, 1, -1, -1, -1, 1, 1}; int dy[] = {1, -1, 0, 0, -1, 1, 1, -1}; template <class T> inline T biton(T n, T pos) { return n | ((T)1 << pos); } template <class T> inline T bitoff(T n, T pos) { return n & ~((T)1 << pos); } template <cl...
#include <bits/stdc++.h> using namespace std; const int N = 1000010, P = 2000010; int f[P]; int n, t, a[N]; int d[N], g[N], r[P]; vector<int> q[P], v[N]; void init(int c, int p) { vector<int> z; int cv = a[c]; d[c] = d[p] + 1; g[c] = -1; if (c == 1) fill(r + 1, r + P, -1); for (int...
// 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 May 22 19:34:37 2017 // Host : GILAMONSTER running 64-bit major release (...
#include <bits/stdc++.h> using namespace std; void ASS(bool bb) { if (!bb) { ++*(int*)0; } } #pragma comment(linker, /STACK:106777216 ) int read() { int x; scanf( %d , &x); return x; } int main() { int k, b, n; k = read(); b = read(); n = read(); map<int, int...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7; const int maxn = 1000000 + 5; const double PI = acos(-1.0); const double E = 2.718281828459; const double eps = 1e-7; int T, n, num[100005]; int main() { long k, n = 19, x = 0, m; scanf( %ld , &k...
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long x, y; cin >> x >> y; long long l = x - y; l = l < 0 ? -l : l; int r = l % 10; long long a = l / 10.0; if (r) a++; cout << a; cout << n ; } } ...
#include <bits/stdc++.h> using namespace std; vector<int> E[1010000]; int n, m, T[1010000]; bool v[1010000]; void DFS(int a) { v[a] = true; int i; for (i = 0; i < E[a].size(); i++) { if (!v[E[a][i]]) DFS(E[a][i]); } } long long Res; int main() { int i, a, b, ck = 0, cc = 0; ...
#include <bits/stdc++.h> using namespace std; int n; int main() { scanf( %d , &n); if (n & 1) printf( %d n , (n - 1) / 2); else { int w = 1; while (w <= n) w *= 2; w /= 2; printf( %d n , (n - w) / 2); } return 0; }
// file: OpenSSD2_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...
`timescale 1ns / 1ps `include "aDefinitions.v" //////////////////////////////////////////////////////////////////////////////////// // // pGB, yet another FPGA fully functional and super fun GB classic clone! // Copyright (C) 2015-2016 Diego Valverde () // // This program is free software; you can redistribute it and...
#include <bits/stdc++.h> using namespace std; vector<pair<int, int> > anom; long long int fact[200005]; long long int invfact[200005]; long long int MOD = 1000000007; long long int dp[2005][25]; long long int invmod(long long int i) { long long int ans = 1; long long int mult = i; long long in...
#include <bits/stdc++.h> using namespace std; unordered_set<string> has_handle; unordered_set<string> is_new; unordered_map<string, string> handle; vector<string> handles_new; vector<string> handles_old; void solve(string old) { if (is_new.count(old)) return; handles_old.push_back(old); string...
#include <bits/stdc++.h> using namespace std; const int INF = 2000000000; const int N = 1e5 + 5; const int TN = 1 << 18; const double PI = acos(-1); int n, m, k; long long tree[TN], lazy[TN] = {0}; void probagate(int l, int r, int p) { tree[p] |= lazy[p]; if (l != r) { lazy[p << 1] |= lazy...
/* Copyright (c) 2014-2018 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, distri...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 13:57:43 05/19/2015 // Design Name: dilation3x3 // Module Name: /home/vka/Programming/VHDL/workspace/sysrek/skin_color_segm/tb_dilation3x3.v // Project Name: vision ...
/***************************************************************************** * File : processing_system7_bfm_v2_0_5_fmsw_gp.v * * Date : 2012-11 * * Description : Mimics FMSW switch. * *****************************************************************************/ `timescale 1ns/1ps module processing_system7_...
// ----------------------------------------------------------------------- // // Copyright 2004 Tommy Thorn - All Rights Reserved // // 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,...
/* * Copyright (c) 2015, Arch Laboratory * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of con...