text
stringlengths
59
71.4k
#include <bits/stdc++.h> using namespace std; int find(int u[], int i) { if (u[i] == i) { return i; } return (u[i] = find(u, u[i])); } int main() { int n, m; cin >> n >> m; if (n != m + 1) { cout << no << endl; return 0; } int ufs[n]; for (int i = 0; i < n...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: bw_clk_gclk_inv_r90_256x.v // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. // // The above named program is free software; you can redistri...
#include <bits/stdc++.h> using namespace std; int main() { int n, q, acum = 0, ultimo = 0, type, a, count; scanf( %d%d , &n, &q); vector<queue<int>> notificaciones_app(n); unordered_set<int> todas_notificaciones; while (q--) { scanf( %d%d , &type, &a); a--; switch (type) { ...
// // Copyright 2011-2012 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 i...
/******************************************************************************* * This file is owned and controlled by Xilinx and must be used solely * * for design, simulation, implementation and creation of design files * * limited to Xilinx devices or technologies. Use with non-Xilinx ...
/** * 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 n, m; int a[100]; long long ans; long long getval() { long long val = 0; for (int i = 0; i < n; ++i) { int mn = 100500; for (int j = i; j < n; ++j) { mn = min(mn, a[j]); val += mn; } } return val; } int mai...
/* * 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...
// A simple OSD implementation. Can be hooked up between a cores // VGA output and the physical VGA pins module osd ( // OSDs pixel clock, should be synchronous to cores pixel clock to // avoid jitter. input clk_sys, // SPI interface input SPI_SCK, input SPI_SS3, input SPI_DI, // ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n, m, flag = 0; cin >> n >> m; long long int a[n][m], b[n][m]; for (long long int(i) = 0; (i) < (n); ++(i)) { for (long long int(j) = 0; (j) < (m); ++(j)) { ...
#include <bits/stdc++.h> using namespace std; template <typename _T, typename _T2> string to_string(pair<_T, _T2> x) { return < + to_string(x.first) + , + to_string(x.second) + > ; } template <typename _T> string to_string(vector<_T> vec) { string s = [ ; for (auto el : vec) s += to_stri...
#include <bits/stdc++.h> using namespace std; int main() { long long int t, n, a, b, x, l, m, e, d, s; cin >> t; while (t--) { cin >> n >> x >> a >> b; if (a > b) { l = a; s = b; } else { l = b; s = a; } d = n - l; if (x <= d) { ...
#include <bits/stdc++.h> #pragma comment(linker, /STACK:256000000 ) using namespace std; const double eps = 1e-50; const int maxN = 1100; const double inf = 1e50; int n, m; vector<int> a[maxN]; double d[maxN][maxN]; int b[maxN]; double c[maxN][maxN]; bool have[maxN]; double t[maxN][maxN], s[max...
#include <bits/stdc++.h> #pragma warning(disable : 4996) #pragma comment(linker, /STACK:336777216 ) using namespace std; int IT_MAX = 1 << 17; int MOD = 1000000007; const int INF = 0x3f3f3f3f; const long long LL_INF = 0x3f3f3f3f3f3f3f3f; const double PI = acos(-1); const double ERR = 1e-10; long lo...
module spi_controller( //CLK input clk, //RST input RST_N, //IRQ to AXI master output o_IRQ, //Signals towards AXI interface: input wire [31:0] i_data_to_registers, input wire i_wr_controll_reg, // Offset: 0x00 input wire i_wr_data_reg, // Offset: 0x08 i...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << n + n / 2; return 0; }
#include <bits/stdc++.h> using namespace std; bool b[31]; struct trie { trie* nt[2]; int tot; trie() { nt[0] = nt[1] = NULL; tot = 0; } }; trie* root = new trie(); void insert(trie* cur, int idx) { if (idx == -1) return; else { int x = b[idx]; if (cur->n...
#include <bits/stdc++.h> using namespace std; struct Node { Node *arr[26]; int state; bool isEnd = false; Node() { for (int i = 0; i < 26; i++) arr[i] = nullptr; isEnd = true; } }; void insert(const string &s, Node *root) { Node *curr = root; for (char c : s) { if (...
#include <bits/stdc++.h> using namespace std; int main() { int n, s, a[1000]; int max = 0; scanf( %d%d , &n, &s); int sum = 0; for (int i = 0; i < n; i++) { scanf( %d , &a[i]); if (a[i] > max) max = a[i]; } int flag = 1; for (int i = 0; i < n; i++) { if (a[i] == max...
#include <bits/stdc++.h> using namespace std; int Head[1000010], Next[1000010], Go[1000010], Val[1000010], iscut[1000010], Len[1000010], Dep[1000010], Fa[400010][21], Cnt = 1, n, m, q; int Head2[1000010], Next2[1000010], Go2[1000010], Val2[1000010], Cnt2 = 1; int DFN[1000010], MIN[1000010], ins[1000010], ...
#include <bits/stdc++.h> using namespace std; long long p, k; long long r[20005]; int i, j; int main() { scanf( %I64d%I64d , &p, &k); while (p) { r[i] = p % (-k); p = p / (-k); while (r[i] < 0) { r[i] = r[i] + k; p++; } i++; } if (i == 0) i++; ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; n--; int a[n]; for (int i = 0; i < n; ++i) { cin >> a[i]; if (a[i] == 0) --i; } int principi; int b[n]; for (int i = 0; i < n; ++i) { ...
#include <bits/stdc++.h> const int mod = 1000000007, hmod = 10000019; int n, a[1000010], p[1000010], f[1000010]; long long sz[1000010]; int g[1000010]; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } int main() { scanf( %d , &n); for (int i = 1; i <= n; i++) scanf( %d , 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...
#include <bits/stdc++.h> using namespace std; int n, i; int p[200011]; int aib[200011]; int ord[2][200011]; int ans[200011]; int zrs(int x) { return (x & (x - 1)) ^ x; } void add(int x, int v) { while (x <= n) { aib[x] += v; x += zrs(x); } } int sum(int x) { int ans = 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; const int MaxN = 100000; int a[MaxN]; int color[MaxN]; bool f = true; int n; int main() { int n, k; cin >> n >> k; for (int i = 1; i <= n; ++i) cin >> a[i]; sort(a + 1, a + n + 1); reverse(a + 1, a + n + 1); while (n % k) { a[n + ...
#include <bits/stdc++.h> using namespace std; const int maxn = 200010; set<pair<long long, long long> > st; int resp[maxn]; struct island { long long ini, fim; } isl[maxn]; struct event { long long type, val, ini; event() { type = 0, val = 0, ini = 0; } event(long long a, long long b, long...
#include <bits/stdc++.h> using namespace std; const int maxn = 15, maxx = 10; long long a[maxn], b[maxn], c[maxn]; void Init() { for (int i = 1; i <= maxx; i++) { long long x = i, l = 1, r = 0; while (x--) l *= 10, r = r * 10 + 9; l /= 10; a[i] = (r - l + 1) * i; b[i] = b[i - 1...
/** * 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; int main() { int t; cin >> t; while (t--) { string s; cin >> s; vector<int> counts; int current_count = 0; for (char c : s) { if (c == 1 ) { current_count += 1; } else if (curre...
/** * 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...
// ZX-Evo Base Configuration (c) NedoPC 2008,2009,2010,2011,2012,2013,2014 // // counter-based 'PFD', based on pentagon design, with filter and adopted to // 28mhz /* This file is part of ZX-Evo Base Configuration firmware. ZX-Evo Base Configuration firmware is free software: you can redistribute it and/o...
#include <bits/stdc++.h> using namespace std; int main() { double ans, p, q, p1, p2, p3; int n, i; scanf( %d , &n); ans = 0.0; q = p2 = p3 = 1; p1 = 0; for (i = 1; i <= n + 1; i++) { if (i <= n) scanf( %lf , &p); else p = 0.0; ans += (1 - p) * p1; ...
#include <bits/stdc++.h> using namespace std; int mat[1010][1010]; int main() { int n, a, b; cin >> n >> a >> b; if (a > 1 && b > 1) { puts( NO ); return (0); } if (n > 1 && n <= 3 && a == 1 && b == 1) { puts( NO ); return (0); } puts( YES ); if (a == 1 && b...
#include <bits/stdc++.h> using namespace std; int n, m; char s[110][110]; void work1() { if (n % 3) { puts( NO ); return; } int k = n / 3; if (s[0][0] == s[k][0] || s[0][0] == s[k * 2][0] || s[k][0] == s[k * 2][0]) { puts( NO ); return; } for (int h = 0; h < 3; h+...
`define FREQ_MHz 200 `define DELAY2CYCLES(d) (`FREQ_MHz*d)/1000 module ftAsyncMode #( parameter DATA = 8, parameter ADDR = 12 )( input clk, // External(uP) Interface input ext_wr, input [DATA-1:0] ext_wr_data, input ext_rd, output reg ext_rd_data_valid, output reg [DATA-1:0] ext_rd...
#include <bits/stdc++.h> using namespace std; const long long INF = 1e18; const long long MOD = 998244353; template <class T> inline void chmax(T &a, const T &b) { if ((a) < (b)) (a) = (b); } template <class T> inline void chmin(T &a, const T &b) { if ((a) > (b)) (a) = (b); } template <typen...
#include <bits/stdc++.h> using namespace std; int a[2001]; int ou, ji; int main() { int n; scanf( %d , &n); long long ans = 0; for (int i = 1; i <= n; i++) { scanf( %d , &a[i]); ans += a[i]; if (a[i] % 2 == 0) ou++; else ji++; } if (ou > ji) ...
#include <bits/stdc++.h> #define int long long using pii=std::pair<int,int>; using namespace std; const int maxn = 2e5 + 5; int n, u, v, a[maxn], in[maxn], out[maxn], order[maxn], timer = -1, st[4 * maxn], need[4 * maxn]; vector<int> adj[maxn]; map<int, vector<int>> avals; void dfs(int x, int p...
// Ten basic tests in here: // 1. byte must be initialised before any initial or always block // 2. assignments to (signed) bytes with random numbers // 3. assignments to (signed) bytes with random values including X and Z // 4. converting unsigned integers to signed bytes // 5. converting signed integers to signed byt...
#include <bits/stdc++.h> using namespace std; using li = long long; using ld = long double; using pii = pair<int, int>; const int INF = 1e9 + 13; const int N = 2e5 + 13; const int M = 1e9 + 7; const int B = 600; const int A = 256; const ld e = 1e-8; const int LOGN = 20; mt19937 rnd(time(0)); v...
`timescale 1ns / 1ps module MicrophoneSampler( output spi_clk, output spi_mosi, output spi_cs, input spi_miso, input clk, input rst, output [9:0] sample ); localparam DELAY_20KHZ = 16'h1388; // decimal 5000 (100 mill / 20,000 = 5000) localparam DELAY_40KHZ = 16'h09C4; // decimal 2500 (100 mill / 40,000 = 25...
#include <bits/stdc++.h> const int MAX_N = 1000000; const int MOD = 1000000007; std::vector<int> groups; int table[1 + MAX_N], dp[1 + MAX_N]; std::deque<int> tablePositions; int main() { std::string s; std::cin >> s; groups.push_back(0); int cnt = 0; for (int i = 0; i < s.size(); ++i) ...
#include <bits/stdc++.h> using namespace std; void pairsort(long long a[], long long b[], long long n) { pair<long long, long long> pairt[n]; for (long long i = 0; i < n; i++) { pairt[i].first = a[i]; pairt[i].second = b[i]; } sort(pairt, pairt + n); for (long long i = 0; i < n; i++)...
#include<bits/stdc++.h> #define LL long long #define dl double #define P pair<int,int> using namespace std; const int N = 2e5 + 10; int n; struct ghb{ int a,b; bool operator < (const ghb &o)const{ return min(a,b) < min(o.a,o.b); } }f[N]; LL ans; int mx; int main(){ /...
#include <bits/stdc++.h> int n, m; std::vector<std::pair<int, int> > a[2]; void normalize(std::vector<std::pair<int, int> >& v) { if (v.empty()) { return; } std::sort((v).begin(), (v).end()); int k = 1; for (int i = 1; i < ((int)(v).size()); i++) { if (v[i].first != v[i - 1].first)...
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2015.3 // Copyright (C) 2015 Xilinx Inc. All rights reserved. // // ============================================================== `timescale 1 ns / 1 ps mod...
#include <bits/stdc++.h> using namespace std; const double Pi = acos(-1.0); int main() { int n, m, cnt, i, j; while (~scanf( %d%d , &n, &m)) { if ((n % 2 == 0 && m * 2 <= n * n) || (n % 2 && m * 2 <= n * n + 1)) { printf( YES n ); cnt = 0; for (i = 1; i <= n; i++) { ...
#include <bits/stdc++.h> #define For(i, a, b) for (int i = (a), _##i = (b); i < _##i; ++i) #define FOR(i, a, b) for (int i = (a), _##i = (b); i <= _##i; ++i) #define Forr(i, a, b) for (int i = (a), _##i = (b); i > _##i; --i) #define FORR(i, a, b) for (int i = (a), _##i = (b); i >= _##i; --i) #define all(a) a....
/* * This module demonstrates the ability to use a defparam to control * the instantation of an instance array, and to also control * parameter values within the instance array. */ module main; localparam wid = 5; reg [wid-1:0] clk; dut xx (.clk(clk)); // This defparam sets the desired with of the U...
#include <bits/stdc++.h> using namespace std; int x[100005], res[100005]; map<int, pair<int, int>> xhMap; int main() { memset(x, 0, sizeof(x)); memset(res, 0, sizeof(res)); int n = 0, a = 0, b = 0; scanf( %d , &n); for (int i = 0; i < n; ++i) { scanf( %d%d , &a, &b); x[i] = 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...
// megafunction wizard: %LPM_MUX% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: LPM_MUX // ============================================================ // File Name: counter_bus_mux.v // Megafunction Name(s): // LPM_MUX // // Simulation Library Files(s): // lpm // ============================...
/******************************************************************************* * This file is owned and controlled by Xilinx and must be used solely * * for design, simulation, implementation and creation of design files * * limited to Xilinx devices or technologies. Use with non-Xilinx ...
#include <bits/stdc++.h> using namespace std; struct SUBS { string _s; int l, r; SUBS() {} SUBS(string s, int l, int r) : _s(s), l(l), r(r) {} bool operator<(const SUBS& subs) const { return _s > subs._s; } }; priority_queue<SUBS> pq; string s; long long n, k; int main() { cin >> s...
#include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = int64_t; using pii = std::pair<i32, i32>; using pll = std::pair<i64, i64>; int dp[5000]; int iv[5000]; bool used[5000]; int div_up(int a, int b) { return (a + b - 1) / b; } void log_pour(int n, int s, int d) { if (n >...
#include <bits/stdc++.h> using namespace std; int countnode(map<int, vector<int>> m, int x, int parent) { int count = 1; for (auto i : m[x]) { if (i != parent) count += countnode(m, i, x); } return count; } int main() { int t; cin >> t; while (t--) { int n, x; cin >...
/** * 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 int mod = 1e9 + 7; const int inf = 1e9; const int N = 2e5; void solve() { long long int d, m; cin >> d >> m; long long int mx; for (long long int i = 32; i >= 0; i--) { if ((1LL << i) & d) { mx = i; break; ...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 100; int n; int t[2][N]; vector<int> vals[N]; vector<pair<int, int>> G[N]; bool vis[N]; int color[N]; vector<int> C[2]; bool cycle; void dfs(int v) { vis[v] = true; C[color[v]].push_back(v); for (auto it : G[v]) { ...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 16:06:54 09/13/2015 // Design Name: Keyboard_dev // Module Name: E:/Seafile/ISE/CPUFly/tests/Keyboard_dev_test.v // Project Name: CPUFly // Target Device: ...
#include <bits/stdc++.h> using namespace std; int main() { int n, a[200000], money, energy, i; scanf( %d , &n); for (i = 0; i <= n - 1; i++) { scanf( %d , &a[i]); } energy = 0; money = a[0]; for (i = 0; i <= n - 2; i++) { if (energy + a[i] - a[i + 1] < 0) { money += a...
#include <bits/stdc++.h> using namespace std; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(float x) { cerr << x; } void __print(double x) { cerr << x; } void __print(long double x) { cerr << x; } void __print(char x) { cerr ...
// megafunction wizard: %In-System Sources and Probes% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsource_probe // ============================================================ // File Name: hps_reset.v // Megafunction Name(s): // altsource_probe // // Simulation Library Files(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...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; template <typename T1, typename T2> inline void chkmin(T1& x, const T2& y) { if (y < x) x = y; } template <typename T1, typename T2> inline void chkmax(T1& x, const T2& y) { ...
#include <bits/stdc++.h> int main() { long long int n; std::cin >> n; if (n % 2 == 0) { std::cout << n / 2 << std::endl; } else { std::cout << -(n + 1) / 2 << std::endl; } return 0; }
//================================================================================================== // Filename : gpio.v // Created On : 2015-01-02 19:44:15 // Last Modified : 2015-05-24 20:58:09 // Revision : // Author : Angel Terrones // Company : Universidad Simón Bolívar // Email ...
/** * 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 int t; cin >> t; long long int i; while (t--) { string a, b, c; cin >> a >> b >> c; long long int n = a.length(), f = 0; for (i = 0; i < n; i++) { if (a[i] != c[i] && b[i] != c[i]) { cout <...
// EE 471 Lab 3, Beck Pang, Spring 2015 // combine SRAM and ALU together // @require: // Instruction formula is formed by 3 bit control, 5 bit for address of A // 5 bit for address of B // fetch instructions and data into SRAM, and then move to register file module DE1_SoCPhaseII (CLOCK_50, LEDR, SW, KEY); input CLOC...
////////////////////////////////////////////////////////////////////// //// //// //// OR1200's Programmable Interrupt Controller //// //// //// //// This file is part of the OpenR...
// -------------------------------------------------------------------------------- //| Avalon ST Idle Inserter // -------------------------------------------------------------------------------- `timescale 1ns / 100ps module altera_avalon_st_idle_inserter ( // Interface: clk input clk, ...
#include <bits/stdc++.h> using namespace std; const int N = 1511, M = 3010100, inf = 0x7fffffff; const long long llinf = 0x7fffffff7fffffffll; long long x[N], y[N], r[N]; long long c[N]; double dist(int i, int j) { return sqrtl((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j])); } double...
#include <bits/stdc++.h> using namespace std; class input { private: bool fail; istream* stream; public: input(istream& stream_ = cin) { stream = &stream_; } istream& getStream() { return *stream; } template <typename T = int> T read() { T value; if (*stream >> value) { ...
/* * 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 law...
#include <bits/stdc++.h> using namespace std; int _c, n, m; int e[70]; long long p[70][70], V, A, B, C, ans, G, F; void dfs2(const long long b, int x) { if (F / b < b) return; if (x > n) { long long c = F / b; if (G * b + b * c + c * G < ans) ans = G * b + b * c + c * G, A = G, 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...
// Copyright (c) 2015 CERN // @author Maciej Suminski <> // // 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) // ...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 16:32:38 01/08/2017 // Design Name: // Module Name: plane // Project Name: // Target Devices: // Tool versions: // Description: // // Dependenc...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of cgu // // Generated // by: wig // on: Mon Jun 26 16:38:04 2006 // cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../nreset2.xls // // !!! Do not edit this file! Autogenerated by MIX !!! // $Author: wig ...
#include <bits/stdc++.h> using namespace std; map<long long int, long long int> mp, mk; set<long long int> s1, s2; vector<long long int> v, w; string s = , p = , q = ; char ch; long long int m, n, c, i, j, k, l, r, x, t, y, u, e, f, g, h, mn, mx, d, z; int main() { cin >> n >> t; if (t == ...
/* Copyright (c) 2014-2016 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...
#include <bits/stdc++.h> using namespace std; int mod = 1e9 + 7; int power(int p, int k) { int a = 1; while (k) { if (k & 1) a = (a * p) % mod; p = (p * p) % mod; k >>= 1; } return a; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int tc = 1; ...
/******************************************************************************/ /* FPGA Sort for VC707 ArchLab. TOKYO TECH */ /* Version 2014-11-26 */ /****************************************************************************...
/** * 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) 2016, 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; long long INF = 1e9; const int maxn = 1e6 + 5; int a[maxn]; int tpr = 0; vector<int> adj[maxn]; void dfs(int root) { if (adj[root].size() > 0) { if (adj[root][0] == (root + 1)) { dfs(root + 1); tpr++; } else return; ...
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const int maxn = 2e5 + 5; long long x[maxn]; long long y[maxn]; int main() { long long x0, y0, ax, ay, bx, by; cin >> x[0] >> y[0] >> ax >> ay >> bx >> by; long long xs, ys, t; cin >> xs >> ys >> t; if (x[0] == y[0...
/* Copyright 2018 Nuclei System Technology, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 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 law...
#include <bits/stdc++.h> using namespace std; vector<pair<int, int> > g[110]; char s[2]; int n, m, x, y, f[110][110][27]; int dp(int x, int y, int k) { if (f[x][y][k] != 0) return f[x][y][k]; int ret = 1; for (auto e : g[x]) if (e.second >= k) ret = min(ret, dp(y, e.first, e.second)); f[...
#include <bits/stdc++.h> using namespace std; const int MM = 2e4 + 5; struct Node { int l, r, lz, mx; } seg[MM * 4]; int n, m, k, dp[55][MM], a[55][MM], b[55][MM]; void build(int u, int l, int r, int i) { seg[u].l = l; seg[u].r = r; seg[u].lz = 0; if (l == r) { seg[u].mx = dp[i - 1...
//---------------------------------------------------------------------- // Title : Demo testbench // Project : Virtex-5 Embedded Tri-Mode Ethernet MAC Wrapper // File : demo_tb.v // Version : 1.8 //----------------------------------------------------------------------------- // // (c) Copyright 2004-2...
module premuat3_32( enable, inverse, i_0, i_1, i_2, i_3, i_4, i_5, i_6, i_7, i_8, i_9, i_10, i_11, i_1...
////////////////////////////////////////////////////////////////////// //// //// //// can_register.v //// //// //// //// ...
#include <bits/stdc++.h> using namespace std; int n, v[5000], d[5000], p[5000], f[5000], ans; queue<int> q; void work() { int i, j, k; scanf( %d , &n); for (i = 1; i <= n; i++) scanf( %d%d%d , &v[i], &d[i], &p[i]); for (i = 1; i <= n; i++) { if (f[i] == 0) { f[i] = 1; for (...
module dmem_tb; parameter DATA_WIDTH = 32; parameter BUS_WIDTH = 24; reg clk; reg re; reg we; reg [DATA_WIDTH-1:0] addr; reg [DATA_WIDTH-1:0] wdata; wire [DATA_WIDTH-1:0] rdata; dmem #( .DATA_WIDTH(DATA_WIDTH), .BUS_WIDTH(BUS_WIDTH) ) dmem ( .clk(clk), ...