text
stringlengths
59
71.4k
// *************************************************************************** // *************************************************************************** // Copyright 2014 - 2018 (c) Analog Devices, Inc. All rights reserved. // // In this HDL repository, there are many different and unique modules, consisting // of...
////////////////////////////////////////////////////////////////////// //// //// //// OR1200's Tick Timer //// //// //// //// This file is part of the OpenR...
/* * 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() { string x; deque<char> vec; int c; bool flag; int max = 0; for (int i = 0; i < 8; i++) { cin >> x; for (int j = 0; j < x.length(); j++) vec.push_back(x[j]); if (i % 2 == 0) { c = 0; while (true) { ...
#include <bits/stdc++.h> using namespace std; template <typename T> inline void next_int(T &x) { x = 0; char c; bool neg = false; while (!isdigit(c = getchar())) if (c == - ) neg = true; do x = x * 10 + c - 48; while (isdigit(c = getchar())); if (neg) x = -x; } template <typ...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of ent_t // // Generated // by: wig // on: Tue Jun 27 05:12:12 2006 // cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../verilog.xls // // !!! Do not edit this file! Autogenerated by MIX !!! // $Author: wi...
// *************************************************************************** // *************************************************************************** // Copyright 2014 - 2017 (c) Analog Devices, Inc. All rights reserved. // // In this HDL repository, there are many different and unique modules, consisting // of...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e4 + 10; const int N = 5e5 + 10; const int INF = 0x3f3f3f3f; const long long mod = 1e9 + 7, G = 3; const int base = 30000; int t; int n, m, k; int dp[35][35][55]; int dfs(int n, int m, int k) { if (k == 0 || n * m == k) return 0; ...
#include <bits/stdc++.h> using namespace std; bool isPal(string s, long long l, long long r) { while (l < r) { if (s[l] != s[r]) return false; l++; r--; } return true; } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; string s; cin >> s; ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long n = s.size(); for (long long i = 0; i < n; i++) { if (s[i] == r ) { cout << i + 1 << n ; } } for (long long i = n - 1; i >= 0; i--) { if (s[i] == l ) { cout << i + 1...
#include <bits/stdc++.h> using namespace std; const int m = 10000 * 100000 + 7; int main() { string s; cin >> s; int n = s.length(); long long p = 0, q = 1; for (int i = n - 1; i > 0; --i) { if (s[i] == 1 ) p = (p + q) % m; q = q * 2 % m; } if (s[0] == 1 ) p = (p + q) % m...
/** * 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> template <class _T> bool maximize(_T &a, _T b) { return a < b ? a = b, 1 : 0; } template <class _T> bool minimize(_T &a, _T b) { return a > b ? a = b, 1 : 0; } const int ooit = 2e9; const long long ooll = 1e15; using namespace std; int n, q, a[200005]; void enter()...
/** * 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 i, j, k, m, n, boys[105], girls[105]; while (cin >> n >> m) { memset(boys, 0, sizeof(boys)); memset(girls, 0, sizeof(girls)); cin >> k; while (k--) { cin >> j; boys[j] = 1; } cin >> k; wh...
#include <bits/stdc++.h> using namespace std; template <typename T> inline T read() { T sum = 0, fl = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (ch == - ) fl = -1; for (; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch - 0 ; return sum * fl; } ...
#include <bits/stdc++.h> using namespace std; template <typename T> int len(const T& a) { return a.size(); } using ll = long long; constexpr long double EPS = 1e-7; long double Check(const vector<long double>& a, long double x) { vector<long double> new_a(a.size()); long double bestmin = 1e8, ...
// megafunction wizard: %LPM_DIVIDE%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: LPM_DIVIDE // ============================================================ // File Name: alt_div.v // Megafunction Name(s): // LPM_DIVIDE // // Simulation Library Files(s): // lpm // ===================================...
#include <bits/stdc++.h> using namespace std; struct node { int a; int b; int index; }; bool compare(node &n1, node &n2) { if (n1.a < n2.a) return true; else return false; } bool compare1(node &n1, node &n2) { if (n1.b < n2.b) return true; else return fals...
#include <bits/stdc++.h> using namespace std; int main() { long long int i, k, b, n, m, r = 0, x = 0, y = 0, z = 0, h = 0, l; string s; cin >> s; n = s.size(); int a[n]; for (i = 0; i < n; i++) { if (s[i] == ( ) x++; else if (s[i] == ) && x > 0) x--; else...
//***************************************************************************** // (c) Copyright 2010 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....
/** * 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 long long mod = 1000000007; const int N = 1000040; long long fact[N], invf[N]; vector<long long> primes; long long add(long long x, long long y) { return (x + y) % mod; } long long mul(long long x, long long y) { return (x % mod) * (y % mod) % mod; } l...
/* * MBus Copyright 2015 Regents of the University of Michigan * * 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 ...
//altpll bandwidth_type="AUTO" CBX_DECLARE_ALL_CONNECTED_PORTS="OFF" clk0_divide_by=125 clk0_duty_cycle=50 clk0_multiply_by=8 clk0_phase_shift="0" device_family="Cyclone IV E" inclk0_input_frequency=20000 intended_device_family="Cyclone IV E" lpm_hint="CBX_MODULE_PREFIX=adc_sclk" operation_mode="no_compensation" pll_ty...
// ---------------------------------------------------------------------- // 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; const int di[] = {-1, 0, 1, 0}; const int dj[] = {0, 1, 0, -1}; const long long MOD = 1e9 + 7; const long long INF = 1e9; const double EPS = 1e-11; int main() { ios::sync_with_stdio(false), cin.tie(0); int n, q, c; cin >> n >> q >> c; vector<pa...
#include <bits/stdc++.h> using namespace std; const int N = 5100; const int oo = 1e9; const int MX = 100000000; const int FF = 33000; int n, m, a[N], gc[N]; int dp[5010], pre[5010]; map<int, bool> bad; map<int, int> cache; vector<int> prime; bool mark[FF + 200]; int gcd(int a, int b) { return !b...
/* * 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; char str[1010000]; int b[1010000]; int a[1010000]; int bb[1010000]; int main() { int n; int flag = 1; scanf( %d , &n); scanf( %s , str); for (int i = 1; i <= n; i++) { scanf( %d , &b[i]); } int coutt1 = 0; for (int i = 0; i ...
//% @file Receive_Data.v //% @brief This module is used to receive data from TMIIa shift register. //% @author pyxiong //% //% When start is asserted, new data will be sent to shift register one by one, //% at the same time , the orginal data stored in shift register will be sent to //% this module, when 170-bit dat...
#include <bits/stdc++.h> using namespace std; long long x, y, nx, ny, k; int main() { cin >> x >> y; nx = x; ny = y; while (x != 1 && y != 1) { if (x > y) { k = x / y; x -= k * y; if (x == 0) { x += y; k--; } } if (x == y) { ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) { int n, m; cin >> n >> m; char a[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> a[i][j]; ...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f, MOD = 1e9 + 7; long long power(long long a, long long n) { long long p = 1; while (n > 0) { if (n % 2) { p = p * a; } n >>= 1; a *= a; } return p; } long long power(long long a, long long ...
#include <bits/stdc++.h> int main() { int sign = 1; int current = 0; int value = 0; for (char c; n != (c = getchar());) { if (c == + or c == - ) { value += sign * current; sign = (c == + ? 1 : -1); current = 0; } current *= 10; current += c - 0 ...
`timescale 1 ns / 1 ps module hapara_bram_dma_dup_v1_0 # ( // Users to add parameters here // User parameters ends // Do not modify the parameters beyond this line // Parameters of Axi Slave Bus Interface S00_AXI parameter integer DATA_WIDTH = 32 ) ( // Users to add ports here input [DATA_WIDTH...
#define _CRT_SECURE_NO_WARNINGS /* To Be or Not To Be !! Allah_Almost3aan Make it happens :) */ #include<bits/stdc++.h> #include<unordered_map> //#include<unorderd_set> using namespace std; using ll = long long; using ld = long double; const ll OO = 1e16; #define ed n #define F first //#def...
//library ieee; //use ieee.std_logic_1164.all; //use ieee.std_logic_unsigned.all; //----------------------------------------------------- // Design Name : ram_dp_sr_sw // File Name : ram_dp_sr_sw.v // Function : Synchronous read write RAM // Coder : Deepak Kumar Tala //-----------------------------...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 14.06.2017 16:31:15 // Design Name: // Module Name: teclado // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // Revis...
(** * Maps: Total and Partial Maps *) (** Maps (or dictionaries) are ubiquitous data structures, both in software construction generally and in the theory of programming languages in particular; we're going to need them in many places in the coming chapters. They also make a nice case study using idea...
/** * 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...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 21:35:45 11/11/2015 // Design Name: // Module Name: LEDRotator // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: //...
module top; reg pass = 1'b1; real in, bin; wire [7:0] out = in; wire signed [34:0] big = bin; initial begin // $monitor(in,, out,, bin,, big); bin = .5; // 2**33+0.5 overflows a 32 bit long. #1; if (big !== 35'sd8589934593) begin $display("Failed: multiword check, expected , got %d", big...
#include <bits/stdc++.h> using namespace std; const int N = 300010; map<pair<pair<int, int>, int>, vector<int> > ans; map<pair<pair<int, int>, int>, vector<pair<int, int> > > l; map<pair<pair<int, int>, int>, vector<pair<int, int> > >::iterator it; int n, m; struct Point { int x, y; Point(int _x =...
// Testbench for ltcminer_icarus.v `timescale 1ns/1ps `ifdef SIM // Avoids wrong top selected if included in ISE/PlanAhead sources module test_ltcminer (); reg clk = 1'b0; reg [31:0] cycle = 32'd0; initial begin clk = 0; while(1) begin #5 clk = 1; #5 clk = 0; end end always @ (posedge clk) ...
#include <bits/stdc++.h> using namespace std; int n; char s[100000 + 10]; int num[30]; int main() { scanf( %d , &n); scanf( %s , s); sort(s, s + n); printf( %s n , s); }
#include <bits/stdc++.h> using namespace std; inline long long read() { long long s = 0, w = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) w = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) s = s * 10 + ch - 0 , ch = getchar(); return s * w; } v...
/* * 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...
////////////////////////////////////////////////////////////////////// // File: CRC32.v // Date: Thu Nov 27 13:56:49 2003 // // Copyright (C) 1999-2003 Easics NV. ...
`timescale 1ns / 1ps //================================================================================================== // Filename : Tenth_Phase_v2.v // Created On : 2016-09-21 17:42:42 // Last Modified : 2016-09-22 00:16:41 // Revision : // Author : Jorge Sequeira Rojas // Company :...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); long long n, k, m, x, ans = 0; cin >> n >> k >> m; vector<pair<long long, long long> > v; for (int i = 0; i < n; i++) { cin >> x; if (v.empty() || (v.back().first != x)) { ...
#include <bits/stdc++.h> using namespace std; int n, m; vector<pair<int, int> > a_sent; vector<pair<int, int> > b_sent; set<pair<int, int> > a_possible; set<pair<int, int> > b_possible; int vis[10]; bool certain(pair<int, int> a, vector<pair<int, int> > sent) { bool can_x = false; bool can_y = f...
#include <bits/stdc++.h> using namespace std; int n, k, f[101][50001], a[101], b[101]; int main() { scanf( %d%d , &n, &k); for (int i = 1; i <= n; i++) scanf( %d , &a[i]); for (int i = 1; i <= n; i++) scanf( %d , &b[i]); for (int i = 0; i <= 100; i++) for (int j = 0; j <= 50000; j++) f[i][j]...
#include <bits/stdc++.h> using namespace std; void solve() { long long n; cin >> n; vector<long long> a(n); for (long long& i : a) cin >> i; vector<long long> pre(n), suf(n); long long cnt{1}; pre[0] = 1; for (long long i = 1; i < n; i++) { if (a[i] > a[i - 1]) { cnt++;...
#include <bits/stdc++.h> #pragma GCC optimize(3) #pragma GCC optimize(2) using namespace std; set<int> st; set<pair<long long, int>> bus[200011]; map<long long, set<pair<int, int>>> q; int n, k, m; int main() { int i; scanf( %d%d%d , &n, &k, &m); for (i = 1; i <= k; ++i) { int xi; ...
#include <bits/stdc++.h> using namespace std; const int dd = (int)2e6 + 7; int A[dd], cnt[dd]; long long tmp[dd]; pair<int, int> msk[20]; int count2[20], w; long long pw[20]; long long ans = 0; void get(int i, long long k) { if (i == w) { ans += tmp[k]; return; } if (count2[i] ...
#include <bits/stdc++.h> using namespace std; template <typename T1, typename T2> istream& operator>>(istream& in, pair<T1, T2>& p) { in >> p.first >> p.second; return in; } template <typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { out << p.first << << p.second;...
#include <bits/stdc++.h> using namespace std; const int maxn = (int)1e5 * 2 + 7; int a[maxn], b[maxn], t[4 * maxn], n, W, H; void build(int v, int l, int r) { if (r - l == 1) { t[v] = a[l]; return; } build(2 * v + 1, l, (l + r) / 2); build(2 * v + 2, (l + r) / 2, r); t[v] = max(t...
#include <bits/stdc++.h> using namespace std; char s[50005]; map<string, int> st; int sq = 300; vector<int> p[500100]; vector<int> h; string s1[500100]; int res[1010][1010]; void pro(int x1, int y1) { int x = h[x1]; int y = h[y1]; int pri = -1, prj = -1; int mn = 1e9; int r; fo...
#include <bits/stdc++.h> using namespace std; const int MAX = 2e5 + 10; int cnt[MAX]; vector<int> up, down; int main() { ios::sync_with_stdio(false); memset(cnt, 0, sizeof(cnt)); int n, x, max_num = -1; cin >> n; for (int i = 0; i < n; i++) { cin >> x; cnt[x]++; max_num =...
/* * 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> int n = 0, m = 0, a[100002], b[1000002], c[1000002]; int main() { while (scanf( %d , &n) != EOF) { memset(a, 0, sizeof(a)); memset(b, 0, sizeof(b)); if (n == 0) continue; int max = 0; int p = 0, q = 0, k = 0; for (int i = 0; i < n; i++) { scan...
#include <bits/stdc++.h> using namespace std; const int maxn = 5009; bool f[maxn][maxn], vis[maxn]; int pre[maxn][maxn], a[maxn]; int n, k, v, sum, cnt; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); ...
#include <bits/stdc++.h> using namespace std; int main() { int n, sub; int grp; cin >> n >> sub; if (n == sub) grp = 0; else if (sub == 0 || sub == 1) grp = 1; else if (sub >= n - n / 2) grp = n - sub; else grp = sub; cout << grp << endl; }
module DM9000A_IF( // HOST Side iDATA, oDATA, iCMD, iRD_N, iWR_N, iCS_N, iRST_N, iCLK, iOSC_50, oINT, // DM9000A Side ENET_DATA, ENET_CMD, ENET_RD_N, ENET_WR_N, ENET_CS_N, ENET_RST_N, ENET_INT, ENET_CLK ); // HOST Side input ...
/** * 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) 2011-2012 Travis Geiselbrecht * * 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, m...
/** * 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; cin >> n; if (n == 0) { cout << 0 << endl; } else if ((n + 1) % 2 == 0) { cout << (n + 1) / 2 << endl; } else { cout << n + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; void BFS(vector<vector<long long> > &graph, long long n, vector<long long> &order) { vector<long long> vis(n + 1); set<long long> PQ; PQ.insert(1); while (!PQ.empty()) { long long x = *PQ.begin(); PQ.erase(PQ.begin()); order....
#include <bits/stdc++.h> using namespace std; const double EPS = 1e-9; namespace number_theory { long long gcd(long long x, long long y) { if (x == 0) return y; if (y == 0) return x; return gcd(y, x % y); } bool isprime(long long n) { if (n <= 1) return false; if (n <= 3) return true; ...
// (c) Copyright 1995-2015 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 license and does not grant ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); long long ca; cin >> ca; while (ca--) { long long n, i, j, k, l, r, m; cin >> l >> r >> m; for (i = l; i <= r; i++) { long long x1, x2; x1 = m / i; if (m % i != 0) ...
#include <bits/stdc++.h> using namespace std; int main() { long long i, j, m, n, k, x, y, sum = 0; cin >> n >> k; vector<long long> sura; vector<pair<long long, long long> > dada; vector<pair<long long, long long> > dada2; vector<long long> su; long long arr[n]; priority_queue<long l...
#include <bits/stdc++.h> using namespace std; int main() { int t, a, b, x; cin >> t; while (t--) { cin >> a >> b; if (a < b) { x = b - a; x % 2 == 0 ? cout << 2 : cout << 1; } else if (a > b) { x = a - b; x % 2 == 0 ? cout << 1 : cout << 2; } else ...
#include <bits/stdc++.h> using namespace std; int n, a; int A[6]; int main() { scanf( %d , &n); for (int i = 0; i < n; i++) { scanf( %d , &A[i]); } sort(A, A + n); printf( %d , A[n / 2]); return 0; }
module dualport_RAM(clk, d_in_1, d_out_1, addr_1, rd_1, wr_1, d_in_2, d_out_2, addr_2, rd_2, wr_2); input clk; input [15:0]d_in_1; output reg [15:0]d_out_1=0; input [7:0]addr_1; // 8 LSB from address input rd_1; input wr_1; input [15:0]d_in_2; output reg [15:0]d_out_2=0; input [7:0]addr_2; // 8 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 la...
#include <bits/stdc++.h> using namespace std; const int M = 1e9 + 7, N = 1e6 + 5; char a[51][51]; int n, m; int vis[51][51]; void dfs(int i, int j) { vis[i][j] = 1; if (i - 1 >= 0 and a[i - 1][j] == # and vis[i - 1][j] == 0) dfs(i - 1, j); if (i + 1 < n and a[i + 1][j] == # and vis[i + 1][j]...
(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012 *) (* \VV/ **************************************************************) (* // * Th...
/* * 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...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of ent_ba // // Generated // by: wig // on: Fri Jul 15 16:37:11 2005 // cmd: h:/work/eclipse/mix/mix_0.pl -strip -nodelta ../../sigport.xls // // !!! Do not edit this file! Autogenerated by MIX !!! // ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 400; int dp[N + 1][N + 1]; bool solve(string str, string t1, string t2) { int n = str.size(); int m = t1.size(); for (int j = 1; j <= m; ++j) dp[0][j] = -1; for (int i = 1; i <= n; ++i) { for (int j = 0; j ...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 14:46:40 03/26/2016 // Design Name: // Module Name: compute // Project Name: // Target Devices: // Tool versions: // Description: sobel¼ÆËãÄ£¿é£¬º...
#include <bits/stdc++.h> int n, m; long long k; long long pow(int n) { if (n == 0) return 1; long long tmp = pow(n >> 1); tmp = tmp * tmp % 1000000009ll; if (n & 1) tmp = tmp * 2ll % 1000000009ll; return tmp; } int main() { scanf( %d%d%I64d , &n, &m, &k); int t = n - m; long lo...
/** * 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 generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2014.4 // Copyright (C) 2014 Xilinx Inc. All rights reserved. // // ============================================================== `timescale 1 ns / 1 ps m...
#include <bits/stdc++.h> using namespace std; const int MAXN = 105; const long long MOD = 1e9 + 7; long long dp[MAXN][MAXN], tmp[MAXN][MAXN]; void fillTmp() { for (int i = 0; i < MAXN; i++) fill(tmp[i], tmp[i] + MAXN, 0); return; } void fillDp() { for (int i = 0; i < MAXN; i++) for (int ...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of inst_t_e // // Generated // by: wig // on: Mon Sep 25 09:53:03 2006 // cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl -nodelta ../../bitsplice.xls // // !!! Do not edit this file! Autogenerated by MIX !...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; char s[maxn]; int size[maxn], last[200]; bool isover[maxn]; string ans[maxn], now; int main() { ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> s; int len = strlen(s); bool hasdel = false; now = ...
/** * 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; int d[1005][2]; char M[1005][1005]; struct Node { int l = 0, r = 0; int p; } L[1005], R[1005]; int n, m; int v[1005]; void Cal(int i) { L[i].l = L[i].p; R[i].l = R[i].p; L[i].r = m - 1 - L[i].p; R[i].r = m - 1 - R[i].p; } int main...
`timescale 1 ns / 1 ps module multiply_accumulate # ( // signal width definitions parameter integer DATA_WIDTH = 16, parameter integer COEFFICIENT_WIDTH = 16, parameter integer CARRY_WIDTH = 48, parameter integer OUTPUT_OFFSET = 0, // operation definitions parameter integer DATA_IN_NUMBER_REGS = 1, parameter ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n > 2) cout << n - 2 << endl; else cout << 7 << endl; }
#include <bits/stdc++.h> int main() { int M, N, d; scanf( %d %d , &M, &N); d = (M * N) / 2; printf( %d , d); return 0; }
/* * 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; long long int mod = 1000000007; bool check(int i, int j, int k) { return (i + j > k && j + k > i && j + i > j); } int main() { int n, ct = 0; cin >> n; for (int i = 1; i <= n; i++) { for (int j = i; j <= n; j++) { int k = i ^ 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 la...