text
stringlengths
59
71.4k
//***************************************************************************** // (c) Copyright 2008-2009 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 // ...
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; string s[n]; unordered_map<string, int> mp; int count = 0; for (int i = 0; i < n; i++) { cin >> s[i]; mp[s[i]] += 1; } for (int i = 0...
#include <bits/stdc++.h> using namespace std; const long long N = 2e5 + 7; const long long inf = 0x3f3f3f3f; signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ; long long t; cin >> t; while (t--) { double pi = 3.1415926535897932384626433832795028841971, n; ...
/////////////////////////////////////////////////////////////////////////////// // // Project: Aurora Module Generator version 2.8 // // Date: $Date: 2007/09/28 12:50:37 $ // Tag: $Name: i+HEAD+134158 $ // File: $RCSfile: tx_stream.ejava,v $ // Rev: $Revision: 1.2 $ // // ...
//-------------------------------------------------------------------------------- // eia232.vhd // // Copyright (C) 2006 Michael Poppitz // // 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 Founda...
#include <bits/stdc++.h> using namespace std; int W, H, N, num; char ch; multiset<int> maxHorSize, maxVertSize; set<int> horiz, vert; long long max_area; long long find_max(set<int> &setCut, char cut) { auto med = setCut.find(num); auto big = med; auto sml = med; ++big; --sml; if (...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2011 by Wilson Snyder. // bug420 typedef logic [7-1:0] wb_ind_t; typedef logic [7-1:0] id_t; module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc=0; reg ...
`timescale 1ns / 1ps module draw_symbols( input reset, input [10:0] vcounter, input [11:0] hcounter, input visible, input [8:0] occupied, input [8:0] symbol, output reg VGA_R, output reg VGA_G, output reg VGA_B ); //upper left position of tic-tac-toe wire [10:0] down; wire [11:0] left; assign down = (479-384)...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2009 by Wilson Snyder. module t; // Speced ignored: system calls. I think this is nasty, so we error instead. // Speced Illegal: inout/output/ref not allowed localparam B1...
/* * File: pippo_pipectrl.v * Project: pippo * Designer: kiss@pwrsemi * Mainteiner: kiss@pwrsemi * Checker: * Assigner: * Description: * Á÷Ë®Ïß¿ØÖÆÐźţ¬Ö÷Òª²úÉú * pc_freeze£º¶³½áPC¼Ä´æÆ÷£¬±£´æµ±Ç°Öµ * if_freeze£º±íʾIF¶ÎÎÞ·¨½ÓÊÜвÙ×÷ * id_freeze£º±íʾID¶ÎÎ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector<int> adj[n]; int deg[n]; for (int i = 0; i < n; i++) { deg[i] = 0; } for (int i = 1; i < n; i++) { int a, b; cin >> a >> b; ...
// Copyright (c) 2013 Gueho Choi, Andrew Downing // 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...
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2016.3 (win64) Build Mon Oct 10 19:07:27 MDT 2016 // Date : Thu Sep 28 09:34:25 2017 // Host : vldmr-PC running 64-bit Service Pack 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 law...
#include <bits/stdc++.h> using namespace std; template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>; long long pl, pr, vl, vr; int k; long long inter(long long a, long long b, long long c, long long d) { return max(0LL, min(b, d) - max(a, c) + 1); } int main() { ios::sync_...
/*########################################################################### *#Clock buffer with built in divider *########################################################################### * * Division ratios: 1,2,3,4,5,6,7,8, and bypass division ratings * * BUFRs can drive: * -I/O logic * -logic resources...
/** * 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; const double EPS = 1E-9; double solve(int r, int c) { vector<double> res(M, 0); for (int y = N - 2; y >= r; y--) { if (M == 1) { res[0] = 2 + res[0]; } else { vector<double> a(M), b(M); a[0] = 1 / 2.0; b[...
#include <bits/stdc++.h> using namespace std; int a[500005]; int q[500005]; int n, k, d; int main() { scanf( %d%d%d , &n, &k, &d); for (int i = 1; i <= n; i++) scanf( %d , &a[i]); sort(a + 1, a + n + 1); int l = 1, r = 1; q[l] = 0; for (int i = k; i <= n; i++) { while (l <= r && ...
`timescale 1ns / 1ps `include "../src/axis_bayer_extractor.v" module test_bayer_extractor( ); localparam RANDOMOUTPUT = 0; localparam RANDOMINPUT = 0; localparam C_COL_ODD = 0; localparam C_ROW_ODD = 0; wire[7:0] mdata; wire mlast; reg mready; wire muser; wire mvalid; wire[7:0] sdata; wi...
// ---------------------------------------------------------------------- // 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:...
/** * 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 n, a, i, j, mid, cnt = 0; cin >> n; for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { cin >> a; if (i == j) cnt = cnt + a; if (i + j == n - 1) cnt = cnt + a; if (i == n / 2) cnt = cnt + a; ...
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); const int N = 1e5 + 7; int pre[N], sz[N], cnt[N], n, lencnt, dx, one; pair<int, int> a[N]; void init() { memset(pre, -1, sizeof(pre)); } int fd(int n) { return pre[n] == -1 ? n : pre[n] = fd(pre[n]); } void mg(int a, int b) { ...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; struct node { int l, r, sum; } hjt[maxn * 40]; int a[maxn], root[maxn], cnt; int last[maxn]; void insert(int l, int r, int pre, int &now, int p, int v) { hjt[++cnt] = hjt[pre]; now = cnt; hjt[now].sum = hjt[pre].sum + ...
#include <bits/stdc++.h> using namespace std; int main() { int n = 0, l = 0, r = 0, x = 0, c[16]; cin >> n >> l >> r >> x; for (int i = 0; i < n; i++) cin >> c[i]; sort(c, c + n); int total = 0, cnt = 0, ret = 0, easy = 0, hard = 0; for (int i = 0; i < (1 << n); i++) { total = 0, cnt =...
/* * Copyright (c) 2000 Mark Schellhorn <> * * 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) * ...
/* Simple button module */ module button ( // input clock clk, // I/O pins pin_in, press, ); input clk; input pin_in; output press; /* Pull-up settings for input: PIN_TYPE: <output_type=0>_<input=1> PULLUP: <enable=1> PACKAGE_PIN: <user pad name> D_I...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; void add(int& x, int y) { ((x += y) >= MOD) && (x -= MOD); } void sub(int& x, int y) { add(x, -y + MOD); } int mul(int x, int y) { return x * 1ll * y % MOD; } int mpow(int a, int p) { int res = 1; for (; p > 0; p >>= 1, a = mul(a...
//`define ZERO_BIT 1'b0 module PP_Compressor(i, pp0, pp1, pp2, pp3, pp4, pp5, pp6, pp7, pp8, pp9, pp10, pp11, pp12, pp13, pp14, pp15, pp16, C, S); input wire[15:0] i; input wire[33:0] pp0; input wire[33: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 la...
#include <bits/stdc++.h> using namespace std; double dp[2010][2010][2][2]; int a[2010]; pair<int, int> le[2010], ri[2010]; int ll[2010][2], rr[2010][2]; int h; double p, q; double go(int l, int r, int Li, int Ri) { if (l > r) return 0; if (dp[l][r][Li][Ri] > -1) { return dp[l][r][Li][Ri]; ...
#include <bits/stdc++.h> int st, h, t, r, n, m, tot; int f[200 + 10][200 + 10] = {0}, g[200 + 10][200 + 10] = {0}; int a[200 + 10][2] = {0}, b[200 + 10][2] = {0}; bool hash[200 + 10][200 + 10] = {0}; int td = 0, top = 0, sum = 0; int totm[2] = {0}, e[2][10000000 + 10] = {0}, last[2][10000000 + 10] = {0}, ...
#include <bits/stdc++.h> using namespace std; int gcd(int f, int s) { if (s == 0) return f; else return gcd(s, f % s); } int const N = 1002006; long long const M = 998244353; long double const ep = .000000000000000001; vector<int> G[N]; long long pw[N]; int od = 0, ev = 0; int vi...
#include <bits/stdc++.h> using namespace std; vector<int> h; vector<vector<int> > g; int h0, v0; vector<int> val; int it = 0; vector<bool> used; vector<int> treesum, par; vector<int> treemin; void update(int v, int l, int r, int ind, int d) { if (l == r) { treesum[v] += d; treemin[v]...
/* @uthor: Amit Kumar user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces: dr_virus_ ;AtCoder,Hackerearth,Hakerrank: dr_virus; */ #include <bits/stdc++.h> #include <chrono> using namespace std; using namespace std::chrono; //#include <boost/multiprecision/cpp_int.hpp> //namespace mp =...
#include <bits/stdc++.h> using namespace std; bool inrange(int y) { return ((y >= 1) && (y <= 9)); } int main() { int r1, r2, c1, c2, d1, d2; bool taken[9] = {false}; cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2; int x = (r1 + r2); int y = (c1 + c2); int z = (d1 + d2); int w; if (x == y...
#include <bits/stdc++.h> using namespace std; char st[100005]; int vis[100005]; int main() { long l, cnt = 0; scanf( %ld , &l); scanf( %s , st); if (l > 26) { cout << -1; return 0; } for (long i = 0; i < l + 10; i++) vis[i] = 0; for (long i = 0; i < l; i++) { if (vi...
#include <bits/stdc++.h> using namespace std; int main() { string str; getline(cin, str); char c = 0; int n = str.length(); for (int i = n - 1; i >= 0; i--) { if ((str[i] >= 65 && str[i] <= 90) || (str[i] >= 97 && str[i] <= 122)) { c = str[i]; break; } } if (c...
/** * 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 = 1e9 + 7; int main() { ios_base::sync_with_stdio(false); cin.tie(); int n; cin >> n; int x; cin >> x; int a[n]; int pp[100005] = {0}; for (int i = 0; i < n; i++) { cin >> a[i]; pp[a[i]]++; } long 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...
/** * 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; const int mod = 1e9 + 7; const int inf = (1 << 30) - 1; const ll infll = (1LL << 61) - 1; double a[1 << 17]; int b[1 << 17], N; ll pos_sum = 0, neg_sum = 0; int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); ci...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 16:24:04 11/07/2015 // Design Name: RAM_Block // Module Name: C:/Users/Camilo/Documents/Xilinx_Workspace/Transflineal/RAM_tst.v // Project Name: Transflineal // Targ...
#include <bits/stdc++.h> using namespace std; const int N = 2 * 100 * 1000; long double l[N]; long double Maks(long double dod, int n) { int i; long double as, mi, w; mi = 0; w = -10000000000000; as = 0; for (i = 1; i <= n; ++i) { as += (l[i] - dod); w = max(w, as - mi); ...
#include <bits/stdc++.h> using namespace std; int regions[100000][4]; string name[100000][3]; void compareScore(int regionNo, int score, string str) { if (score >= regions[regionNo][0]) { string tempName1 = name[regionNo][0]; string tempName2 = name[regionNo][1]; int tempScore1 = regions[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...
/* * 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 MOD = 998244353; int sum(int a, int b) { return (a + b) % MOD; } int prod(int a, int b) { return a * 1ll * b % MOD; } int mpow(int b, int e) { if (e == 0) return 1; if (e & 1) return prod(b, mpow(b, e - 1)); return mpow(prod(b, b), e / 2); ...
#include <bits/stdc++.h> using namespace std; map<string, string> p; map<string, string>::iterator it = p.begin(); int main() { int q; cin >> q; while (q--) { string s1, s2; cin >> s1 >> s2; if (!p.count(s1)) p[s2] = s1; else { p[s2] = p[s1]; p.erase(s...
#include <bits/stdc++.h> using namespace std; long long s, x; int main() { cin >> s >> x; s -= x; if (s < 0 || s % 2 != 0) { cout << 0 << endl; return 0; } s /= 2; if (s & x) { cout << 0 << endl; return 0; } long long bit = 0, result = 0; if (!s) result ...
#include <bits/stdc++.h> using namespace std; int n, r, f[60005]; int dp[105][60005]; struct node { int a, b, sign; } pro[105]; bool cmp(node a, node b) { if (a.sign == b.sign) { if (a.sign == 1) return a.a < b.a; else return a.a + a.b > b.a + b.b; } return a.sign...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////// //// //// //// //// //// Divisor de frecuencia //// //// ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); bool t = true; int n; cin >> n; int a[200001] = {0}; vector<int> voz; vector<int> yb; for (int i = 0; i < n; i++) { int c; cin >> c; ...
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; bool mysort(pair<long long, long long> A, pair<long long, long long> B) { return A.second > B.second; } long long moduloMultiplication(long long a, long long b, long long mod) { long long res = 0; a %= mod; while (b) { ...
// DESCRIPTION: Verilator: Verilog Test module // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2019 by Todd Strader. // SPDX-License-Identifier: CC0-1.0 module secret #(parameter GATED_CLK = 0) ( input [31:0] accum_in, output wire [31:0] accum_out, ...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 17:12:55 03/06/2016 // Design Name: sumcomp // Module Name: C:/XilinxP/Practica1/sumcomp_test.v // Project Name: Practica1 // Target Device: // Tool ver...
/** * 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 1986-2014 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2014.4 (win64) Build Tue Nov 18 18:29:27 MST 2014 // Date : Tue Jun 30 15:23:02 2015 // Host : Vangelis-PC running 64-bit major release (...
#include <bits/stdc++.h> using namespace std; int n, i, j, k, l, mx; int a[100001]; int p[100001], miu[100001], len; vector<int> b[100001]; vector<int> c[100001]; bool bz[100001]; int f[100001]; long long ans, s; bool cmp(int a, int b) { return a > b; } int gcd(int x, int y) { int r = x % y; ...
//Fibonacci Test Bench //Test Bench for Multiplier Functional Unit module FibonacciTB; reg clk, reset; wire [15:0] result; reg [7:0] n; wire ready; //Data containing 0 reg [7:0] test0Data = 8'b0; //Data containing 1 reg [7:0] test1Data = 8'b1; // Test regular fibonacci number reg [7:0] testOrdina...
#include <bits/stdc++.h> using namespace std; using int64 = long long; template <class T> struct Matrix { vector<vector<T> > A; Matrix() {} Matrix(size_t n, size_t m) : A(n, vector<T>(m, 0)) {} Matrix(size_t n) : A(n, vector<T>(n, 0)){}; size_t height() const { return (A.size()); } size_...
#include <bits/stdc++.h> using namespace std; struct node { int Tea; int Index; friend bool operator<(const node& a, const node& b) { return a.Tea > b.Tea; } } D[105]; int main() { int i, n, w, Ans[105]; scanf( %d%d , &n, &w); for (i = 0; i < n; i++) { scanf( %d , &D[i].Tea); ...
#include <bits/stdc++.h> using namespace std; char ans[1000005], tmp[1000005]; int wa; int n, x; void go(int x, int y) { int len = 0; while (x != y) { if (x < y) { y -= x; tmp[len++] = B ; } else { x -= y; tmp[len++] = T ; } if (len >= n) retur...
#include <bits/stdc++.h> using namespace std; long long P(long long m, long long n); long long pi(long long x); long long phi(long long m, long long n); bool isprm[400005]; int cntprm[400005]; vector<long long> prm; void Init() { for (int i = 2; i <= 400000; ++i) { isprm[i] = true; } f...
/* * 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 Header Begin ========================================== // // OpenSPARC T1 Processor File: jbi_dbg.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 redistribute it and/or //...
module ex_stage( input clk, input rst, input wb_reg_write, input wb_mem_to_reg, input mem_read, input mem_write, input ...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 100; int a[maxn], ans[maxn]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m, c; cin >> n >> m >> c; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) { int ...
// Copyright 2020-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...
#include <bits/stdc++.h> using namespace std; int a[110], n = 0, res[1010], ch = 0, k = 0; string s; int main() { cin >> s; memset(a, 0, sizeof a); memset(res, 0, sizeof res); for (int i = 0; i < (int)s.length(); ++i) if (s[i] != , ) { a[n] *= 10; a[n] += (int)(s[i] - 0 )...
#include <bits/stdc++.h> using namespace std; const long long int MOD = 998244353; const long long int INF = 3e18; long long int power(long long int base, long long int exp) { long long int res = 1; while (exp > 0) { if (exp % 2 == 1) res = (res * base); base = (base * base); exp /= 2;...
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1.0); const int dx4[] = {-1, 0, 1, 0}; const int dy4[] = {0, 1, 0, -1}; const int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1}; const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1}; const int dxk[] = {-2, -2, -1, -1, 1, 1, 2, 2}; const int dyk[] = {-...
#include <bits/stdc++.h> using namespace std; const int MOD = 32768, N = 109; char ch; string s[N], t; int ans, v, f[MOD + 9], num, p, pos; int ex(); int gt() { int ret = 0; if (t[pos] == n ) return pos++, v; if (t[pos] == f ) return pos += 2, ret = f[ex()], pos++, ret; while (t[pos] >= ...
/** * 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; char a[55][55]; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; int n, T, m; inline int valid(int x, int y) { return x >= 0 && x < n && y >= 0 && y < m; } int cyc[55][55][4][2] = {}; int main(void) { scanf( %d%d , &n, &T); for (int i = 0; i < n; i++)...
// 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 : Sat May 27 21:25:06 2017 // Host : GILAMONSTER running 64-bit major release (...
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f, mod = 998244353; const long long INF = 0x3f3f3f3f3f3f3f3fLL; const double pi = acosl(-1.), eps = 1e-9; inline void sum(int &a, int b) { a += b; if (a >= mod) a -= mod; } const int NN = 1000100; char A[NN], L[NN], R[NN]; ...
`timescale 1ns / 1ps module display_refresher( input clk, input DISPLAY1, input DISPLAY2, input DISPLAY3, input DISPLAY4, output reg [6:0] DISPLAY, output reg [3:0] ANODES, output reg contador_seg ); /* HERE STARTS THE REFRESHING MACHINE */ reg [1:0] Prstate, Nxtstate; parameter S0 = 2'b00...
/** * 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...
module diffeq_paj_convert (Xinport, Yinport, Uinport, Aport, DXport, Xoutport, Youtport, Uoutport, clk, reset); input[31:0] Xinport; input[31:0] Yinport; input[31:0] Uinport; input[31:0] Aport; input[31:0] DXport; input clk; input reset; output[31:0] Xoutport; output[31:0] Y...
// (C) 2001-2016 Intel Corporation. All rights reserved. // Your use of Intel 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 docum...
#include <bits/stdc++.h> using namespace std; int main() { int x0, y0, x1, y1; cin >> x0 >> y0 >> x1 >> y1; int n; cin >> n; multimap<int, pair<long long int, long long int> > sections; for (long long int i = 0; i < n; i++) { int r, a, b; cin >> r >> a >> b; sections.insert...
#include <bits/stdc++.h> using namespace std; struct less_key { bool operator()(pair<double, int64_t> p1, pair<double, int64_t> p2) { return (p1.first > p2.first) || ((p1.first == p2.first) && (p1.second < p2.second)); } }; struct pair_hash { std::size_t operator()(const pair<int6...
#include <bits/stdc++.h> using namespace std; char a[2048][2048]; int flagr[2048], flagc[2048]; int n, ans = 0; void print() { cout << endl; cout << ========== << endl; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) cout << a[i][j]; cout << endl; } cout << endl; ...
/** * 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...
////////////////////////////////////////////////////////////////////// //// //// //// OR1200's IC FSM //// //// //// //// This file is part of the OpenR...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; const int SIZE = 1e6 + 5; const long long INF = 1LL << 58; const double eps = 1e-10; char d[2009][2009]; char a[2009][2009]; int dy[4] = {-1, 0, 1, 0}; int dx[4] = {0, 1, 0, -1}; int dy2[8] = {-2, -1, 0, 1, 2, 1, 0, -1}; ...
// Accellera Standard V2.3 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2008. All rights reserved. `ifdef OVL_ASSERT_ON wire xzcheck_enable; reg xzcheck_window = 0; `ifdef OVL_XCHECK_OFF assign xzcheck_enable = 1'b0; `else `ifdef OVL_IMPLICIT_XCHECK_OFF assign xzcheck_enable = 1'b0; ...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int N = 1020; int main() { int n; cin >> n; if (n % 2 == 0) { cout << -1 << endl; } else { cout << 0; for (int i = 1; i < n; i++) { cout << << i; } cout << endl; cout <...
#include <bits/stdc++.h> using namespace std; int main(void) { int n; scanf( %d , &n); vector<vector<int> > p(n); for (int i = 0; i < n; i++) { int sz; scanf( %d , &sz); p[i].resize(sz); for (int j = 0; j < sz; j++) scanf( %d , &p[i][j]); } for (int i = 0; i < n; i++)...
#include <bits/stdc++.h> using namespace std; vector<long long> adj[200005]; long long siz = 0; long long cc = 0; long long t, n; long long a[200005]; long long vis[200005]; long long size_dict[200005]; void dfs(long long u) { vis[u] = cc; siz += 1; for (long long i = 0; i < adj[u].size();...
//================================================================================================== // Filename : RKOA_OPCHANGE.v // Created On : 2016-10-26 23:25:59 // Last Modified : 2016-10-27 08:30:43 // Revision : // Author : Jorge Esteban Sequeira Rojas // Company : Instituto Tec...
#include <bits/stdc++.h> using namespace std; int knigths[300006]; set<int> s; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL), cout.tie(NULL); ios::sync_with_stdio(false), cin.tie(0); int n, m; cin >> n >> m; for (int i = 1; i <= n + 1; i++) s.insert(i); for (int i = 0; i <...
// Copyright (c) 2016 CERN // 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) // any late...
#include <bits/stdc++.h> using namespace std; template <class T> int len(const T &c) { return (int)c.size(); } template <class T> void cmin(T &a, T b) { if (b < a) a = b; } template <class T> void cmax(T &a, T b) { if (b > a) a = b; } vector<pair<int, int> > v; int main() { int n...
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; long long mod = 1000000007; const int MX = 0x3f3f3f3f; bool G[8][8]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; if (n <= 6) { cout << m << endl; return ...