text
stringlengths
59
71.4k
/* * 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; long long fac[300011], inv[300011]; int F, W, H; long long fastpower(long long v, long long p) { long long ret = 1; while (p > 0) { if (p % 2 == 1) { ret = ret * v; ret %= mod; p--; } el...
/** * 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: %FIFO%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: scfifo // ============================================================ // File Name: sfifo_31x128.v // Megafunction Name(s): // scfifo // ============================================================ // ***************...
/* * 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 main() { int n, m; scanf( %d%d , &n, &m); int a[n], b[m], i, j; for (i = 0; i < n; i++) scanf( %d , &a[i]); for (i = 0; i < m; i++) scanf( %d , &b[i]); for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { if (b[j] == a[i]) printf( %d , a[i]); } ...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; const int M = 1e3 + 10; const long long mod = 1e9 + 7; const long long inf = 1e18 + 10; int a[N], st[N], ft[N], ind[N], lzy[4 * N], t, n, m; vector<int> adj[N]; bitset<M> seg[4 * N], P, res, one; void dfs(int v, int p) { st[v] =...
// part of NeoGS flash programmer project (c) 2014 lvd^NedoPC // // rom controller // // !!!!!!!!!!!enables addr bus as soon as reset is removed!!!!!!! module rom ( input wire clk, input wire rst_n, input wire wr_addr, input wire wr_data, input wire rd_data, input wire [ 7:0] wr_buff...
#include <bits/stdc++.h> using namespace std; const int maxn = 300100; int read() { int x = 0, w = 1; char ch = 0; while (!isdigit(ch)) { ch = getchar(); if (ch == - ) w = -1; } while (isdigit(ch)) x = x * 10 + ch - 0 , ch = getchar(); return x * w; } vector<int> G[maxn];...
// ddc_2.v - decimating downconverter V2 - runs at full 40MSPS // 07-17-16 E. Brombaugh module ddc_2 #( parameter isz = 10, fsz = 26, osz = 16 ) ( input clk, reset, input [isz-1:0] in, input [fsz-1:0] frq, input ns_ena, output reg valid, output reg signed [osz-1:...
///////////////////////////////////////////////////////////////////// //// //// //// SHA-256 //// //// Secure Hash Algorithm (SHA-256) testbench //// //// ...
#include <bits/stdc++.h> using namespace std; vector<int> r; vector<int> l; int n, ans, a[550000]; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; a[0] = a[1]; a[n + 1] = a[n]; for (int i = 1; i <= n; i++) { if (a[i] == a[i + 1] && a[i] != a[i - 1]) r.push_back(i); ...
module testit; reg clk; reg a_i; reg b_i; reg a_o; reg b_o; reg rst_n; reg [7:0] shreg; //== State enumeration parameter [2:0] // synopsys enum state_info SM_IDLE = 3'b000, ...
#include <bits/stdc++.h> using namespace std; int main() { long long n, d, m, l, i, j, x; cin >> n >> d >> m >> l; for (i = 0; i < n - 1; i++) { if ((i * m + l) / d * d + d < (i + 1) * m) break; } cout << (i * m + l) / d * d + d; return 0; }
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 5; const int INF = 0x3f3f3f3f; const long long llINF = 0x3f3f3f3f3f3f3f3f; const int mod = 998244353; long long read() { long long x = 0, w = 1; char ch = 0; while (!isdigit(ch)) { if (ch == - ) w = -1; ch = getchar()...
#include <bits/stdc++.h> using namespace std; void print_ret(const std::vector<long long>& ret) { long long r = 0; for (typeof((ret).end()) it = (ret).begin(); it != (ret).end(); ++it) r ^= *it; cout << r << endl; cout << ret.size() << endl; for (typeof((ret).end()) it = (ret).begin(); it ...
// mbt 9/8/2014 // // bsg_front_side_bus_hop_in // // This implements the front side bus // input side. In normal use, nodes // must always keep their ready_i lines // high and admit any data that arrives. // Otherwise deadlock is likely, especially // if multiple nodes are in use at once. // // This means in practice ...
/** * 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; long long N, K; long long s1, s2, p1, p2; long long Get(long long now, long long to) { if (now <= to << 1) return 0; long long re = 0; s1 = 1; s2 = 0; p1 = now; p2 = now - 1; while (p2 >= to << 1) { if (p2 == to << 1) return s1 + re...
#include <bits/stdc++.h> using namespace std; int main() { int n, c = 0; cin >> n; bool* V = new bool[n]; bool Back = false; for (int i = 0; i < n; ++i) { cin >> V[i]; if (V[i]) { if (Back && c) c++; c++; Back = false; } else { Back = true; ...
#include <bits/stdc++.h> using namespace std; template <typename T> T abs(T a) { return a < 0 ? -a : a; } template <typename T> T sqr(T a) { return a * a; } const int INF = (int)1e9; const long double EPS = 1e-9; const long double PI = 3.1415926535897932384626433832795; long double a, b, h...
#include <bits/stdc++.h> using namespace std; const int MaxN = 123456, Mod = 1000000000; long long a[MaxN], f[MaxN]; int main(void) { int i, j, n, m; f[0] = f[1] = 1; for (i = 2; i < MaxN; i++) f[i] = (f[i - 1] + f[i - 2]) % Mod; while (scanf( %d %d , &n, &m) != EOF) { int i, t, l, r; ...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); } long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); } const int MAXN = 600010; set<int> g[MAXN]; int n, t, m, k; int visited[MAXN]...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; int main() { ios_base::sync_with_stdio(false); int t; cin >> t; while (t--) { ll a, b, c; cin >> a >> b >> c; ll x, y; if (a == c and b == 1) { cout << -1 -1 << n ;...
/* Copyright 2015, Google 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/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
#include <bits/stdc++.h> using namespace std; bool check(int x1, int y1, int r1, int x2, int y2, int r2, int R2) { int l = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); int rr1 = (r1 - r2) * (r1 - r2); int rr2 = (r1 + r2) * (r1 + r2); int RR1 = (r1 - R2) * (r1 - R2); int RR2 = (r1 + R2) * (r1 +...
`timescale 1ns / 1ns `define HALT 4'hF module opc2tb(); reg [7:0] mem [ 2047:0 ]; reg clk, reset_b; wire [9:0] addr; wire rnw ; wire ceb = 1'b0; wire oeb = !rnw; wire [7:0] data = ( !ceb & rnw & !oeb ) ? mem[ addr ] : 8'bz ; // OPC CPU instantiation opc2cpu dut0_u (.address(addr), .data(data), ....
#include <bits/stdc++.h> using namespace std; long long mp[2050][2050]; int main() { for (int i = 0; i <= 1000; i++) { mp[i][0] = 1; mp[i][i] = 1; } for (int i = 0; i <= 1000; i++) { for (int j = 1; j < i; j++) { mp[i][j] = (mp[i - 1][j] + mp[i - 1][j - 1]) % 1000000007; ...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; template <class T, class U> inline void add_self(T &a, U b) { a += b; if (a >= mod) a -= mod; if (a < 0) a += mod; } template <class T, class U> inline void min_self(T &x, U y) { if (y < x) x = y; } template <class ...
/** * 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 "../include/tune.v" // PentEvo project (c) NedoPC 2008-2011 // // vertical blank, sync and window. H is period of horizontal sync; // from the last non-blanked line: // 3H is pre-blank, // 2.xxH is vertical sync (slightly more than 2H, all hsync edges preserved) // vblank is total of 25H module vid...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed under the Creative Commons Public Domain, for // any use, without warranty, 2018 by Wilson Snyder. // SPDX-License-Identifier: CC0-1.0 module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc; initial cyc=1; reg [15:...
#include <bits/stdc++.h> using namespace std; void fastIo() { ios_base::sync_with_stdio(false); cin.tie(NULL); } int main() { fastIo(); int q; cin >> q; while (q--) { int n; cin >> n; string s; cin >> s; if (n == 1) { cout << NO << endl; } el...
`timescale 1ns/1ns `define DAC_MSB 7 `define ADC_MSB 15 `define NSEC 1 `define USEC (`NSEC*1000) `define MSEC (`USEC*1000) // TOPLEVEL TO STIMULATE module toy_toplevel( input wire [`ADC_MSB:0] V_load_adc, input wire V_load_valid, output reg pwm, output reg [`DAC_MSB:0] V_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...
/** * 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...
////////////////////////////////////////////////////////////////////// //// //// //// dbg_sync_clk1_clk2.v //// //// //// //// This file is part of the SoC/O...
#include <bits/stdc++.h> using namespace std; int Q, m, n, a[10001], c[100001], ans, f[5001][101], d[1001]; char b[500001][13]; void dfs(int x, int now, int zong, int he) { if (x > n) { if (zong <= 100) f[he][zong] += c[now]; return; } dfs(x + 1, now * 2 + 1, zong + (d[x] == 1 ? a[x] : 0...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int arr; int a = 0, b = 0, i, j, k; for (i = 0; i < n; i++) { cin >> arr; if (arr >= 0) { a += arr; } else { b += arr; } } cout << a - b << endl; return 0; }
// Copyright (c) 2000-2013 Bluespec, Inc. // 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, publ...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 2; int tree[N * 32][2], cnt[N * 32]; long long int curr = 1, n, ans; vector<long long int> arr(N); void clean() { for (long long int i = 0; i <= N * 32 - 1; i++) tree[i][0] = tree[i][1] = -1; } void add(long long int x) { long lon...
#include <bits/stdc++.h> using namespace std; int main() { int n, pos, l, r, diff, rflag = 1, lflag = 1; cin >> n >> pos >> l >> r; diff = r - l; if (l == 1) lflag = 0; if (r == n) rflag = 0; if (lflag == 0 && rflag == 0) cout << 0; else if (lflag == 0) cout << abs(r - pos) +...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2005 by Wilson Snyder. module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc; initial cyc=1; parameter ONE = 1; wire [17:10] bitout; reg [7:0] allbi...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; const long long N = 2e5 + 6; const long long inf = 1e15; long long ex, ey, ez, bx, by, bz, a[7]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); if (fopen( inp.txt , r )) { freopen( inp.txt , r , stdin)...
// megafunction wizard: %FIFO% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: dcfifo // ============================================================ // File Name: audio_fifo.v // Megafunction Name(s): // dcfifo // // Simulation Library Files(s): // altera_mf // ================================...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int n, m, k, a[N]; long long rem, cnt, sum; double ans; int main() { cin >> n >> k >> m; for (int i = 1; i <= n; ++i) { scanf( %d , a + i); sum += a[i]; } sort(a + 1, a + n + 1); for (int i = 1; i <= n; ++i)...
#include <bits/stdc++.h> using namespace std; void s() { puts( Stannis ); } void d() { puts( Daenerys ); } int main() { int n, k; scanf( %d %d , &n, &k); int odd = 0; int even = 0; long long tot = 0; for (int i = 0; i < n; i++) { int x; scanf( %d , &x); if (x % 2 == 0) ...
// megafunction wizard: %ROM: 1-PORT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsyncram // ============================================================ // File Name: three_new2.v // Megafunction Name(s): // altsyncram // // Simulation Library Files(s): // altera_mf // =============================...
#include <bits/stdc++.h> using namespace std; #pragma comment(linker, /STACK:102400000,102400000 ) const int N = 205; int n; long long a[N]; map<long long, int> mp; vector<int> G[N], ans; bool vis[N]; bool dfs(int u, int step) { if (step == n) { ans.push_back(u); return true; } ...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; const long long INF = 1e18; int n; int p[N]; long long dif[N]; long long ans = INF; int id; void add(int l, int r, int val) { dif[l] += val; dif[r + 1] -= val; } int main() { ios_base::sync_with_stdio(0); cin.tie(...
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ *********...
#include <bits/stdc++.h> using namespace std; const int N = 200000 + 10; int n; long long x[N], y[N]; int main() { scanf( %d , &n); for (int i = 1; i <= n; i++) { scanf( %lld%lld , &x[i], &y[i]); } while (1) { vector<int> r; for (int i = 1; i <= n; i++) { if ((x[i] + ...
/* Copyright (c) 2015 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
#include <bits/stdc++.h> using namespace std; int getint() { int x = 0; char c = getchar(); while (c < 0 || c > 9 ) c = getchar(); while (c >= 0 && c <= 9 ) x *= 10, x += (c - 0 ), c = getchar(); return x; } vector<pair<int, int> > ans; int n, m, tag; int a[40][40], b[40][40], cnt...
// 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 : Thu May 25 15:17:13 2017 // Host : GILAMONSTER running 64-bit major release (...
/* Copyright (c) 2015 LeafLabs LLC Author: Charlie Lamantia Date: December 2015 Testbench for rhd2000_dm. Exercises all available SPI commands including ADC data conversion via concatenated input array "analogIn". */ `timescale 1ns / 1ps `define STARTDELAY 100 `include "llLib.v" module rhd200...
#include <bits/stdc++.h> using namespace std; int n, q; int m; int lastans; int a[1000][700]; int b[100100]; int sz[1000]; short int cnt[1000][100100]; void remake() { int pos = 0; for (int i = 0; i <= m; i++) { sz[i] = 0; for (int j = 0; j < 700; a[i][j] = 0, j++) { if (a[...
#include <bits/stdc++.h> using namespace std; const int INF = 0x6fffffff; const int MINF = 0x80000000; const long long mod = 1000000007; const int cons = 100001; const double pi = 3.141592653589793; vector<int> pos; bool isOk(int x, int t) { double res = 0; for (int i = 1; i < pos.size(); i++) {...
// megafunction wizard: %LPM_MULT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: lpm_mult // ============================================================ // File Name: gsu_mult.v // Megafunction Name(s): // lpm_mult // // Simulation Library Files(s): // lpm // ============================================...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; long long ans = 0; for (int i = (0); i < (n); ++i) { long long t, T, x, cost; cin >> t >> T >> x >> cost; if (t >= T) { ans += cost + m * x; continue; } long long aux1 = ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); unsigned long long c = 0; short p; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> p; c += p; } cout << setprecision(14) << ((double)c / n); }
// (C) 2001-2017 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; long long modpow(long long a, long long b, long long m = 1000000007) { a %= m; long long res = 1; while (b) { if (b & 1) res = res * a % m; a = a * a % m; b >>= 1; } return res; } long long bpow(long long a, long long b) { l...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 02:10:17 05/08/2017 // Design Name: axi_spi_if // Module Name: D:/Projects/Rendszerarch/axi_spi_master_if/axi_spi/axi_spi_test.v // Project Name: axi_spi /...
/** * 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) 1995/2010 Xilinx, Inc. // All Right Reserved. /////////////////////////////////////////////////////////////////////////////// // ____ ____ // / /\/ / // /___/ \ / Vendor : Xilinx // \ \ \/ Version : 13....
#include <bits/stdc++.h> using namespace std; inline void Boost() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } const long double eps = 1e-10; int main() { Boost(); int n; cin >> n; vector<long double> A(n), B(n); for (auto &x : A) cin >> x; for (auto &x :...
#include <bits/stdc++.h> using namespace std; int a[5]; bool able[5]; int main() { int T; scanf( %d , &T); while (T--) { for (int i = 1; i <= 4; i++) able[i] = true; bool flag = true; for (int i = 1; i <= 4; i++) scanf( %d , &a[i]); if ((a[1] + a[2]) % 2 == 1) flag = false; ...
/* * 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) 2016 Cedric Orban This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the ho...
/*------------------------------------------------------------------------------ * This code was generated by Spiral Multiplier Block Generator, www.spiral.net * Copyright (c) 2006, Carnegie Mellon University * All rights reserved. * The code is distributed under a BSD style license * (see http://www.opensource.or...
#include <bits/stdc++.h> using namespace std; int n, m, k; string s; long long ans; bool flag; struct A { int id, p, s; }; bool comp(A a, A b) { if (a.p > b.p) return true; return false; } void solve() { cin >> n >> m >> k; vector<int> p(n); for (auto i = 0; i < n; i++) cin >...
#include <bits/stdc++.h> using namespace std; int x[4]; int y[4]; int newx[4]; int newy[4]; int T; int get() { int answ = INT_MAX; for (auto y1 : y) for (auto y2 : y) { int delta = abs(y1 - y2); if (delta == 0) continue; set<int> s; for (auto x1 : x) ...
// // Generated by Bluespec Compiler, version 2021.07 (build 4cac6eb) // // // Ports: // Name I/O size props // RDY_server_reset_request_put O 1 reg // RDY_server_reset_response_get O 1 // read_rs1 O 64 // read_rs1_port2 O 64 // read_rs2 ...
#include <bits/stdc++.h> using namespace std; const int maxn = 200000 + 10; long long n, T, a[maxn], x, y, t1, t2, k; long long b[maxn]; long long cmp(long long x, long long y) { return x > y; } long long cmp1(long long x, long long y) { return x > y; } long long check(long long len) { for (long long ...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const double eps = 1e-6; const int MAXN = 1e5 + 10; const int MAXM = 1e6 + 10; const long long mod = 1e9 + 7; int a[1010]; int main() { int n; scanf( %d , &n); for (int i = 0; i < n; i++) scanf( %d , &a[i]); int an...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0), cin.tie(0); int t; cin >> t; while (t--) { int n, m, k; cin >> n >> m >> k; vector<int> deg(n); vector<vector<int>> adj(n); for (int i = 0, u, v; i < m; ++i) { cin >> u >> v...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 01/24/2016 03:50:03 PM // Design Name: // Module Name: Problem4 // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // // R...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2011 by Jeremy Bennett. // SPDX-License-Identifier: CC0-1.0 module t (/*AUTOARG*/ // Inputs clk ); input clk; wire [19:10] bitout; wire [29:24] short_bitout; wir...
#include <bits/stdc++.h> using namespace std; int main() { int l, p, q; cin >> l >> p >> q; double ans; ans = (double)l * p / ((p + q)); cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int h, m, s, t1, t2; cin >> h >> m >> s >> t1 >> t2; h %= 12; t1 %= 12; t2 %= 12; m /= 5; s /= 5; if (t1 > t2) swap(t1, t2); if (((h >= t1 && h < t2) + (m...
/////////////////////////////////////////////////////////////////////////////// // $Id: ethernet_parser_64bit.v 2201 2007-08-21 06:52:51Z jnaous $ // // Module: ethernet_parser_64bit.v // Project: NF2.1 // Description: parses the Ethernet header for a 64 bit datapath // /////////////////////////////////////////////////...
// part of NeoGS project (c) 2007-2008 NedoPC // // sound_main is the main sound module: it incorporates data storage (512b memory), from which // it reads data, prepares it through sound_mulacc and sends to sound_dac. It incorporates in itself // sound_dac, so it has outs to the DAC. // clock is ordinary 24 MHz cloc...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2004 by Wilson Snyder. module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc; initial cyc=0; wire signed [7:0] sgn_wide; wire [7:0] unsgn_wide; ...
/** * 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...
////////////////////////////////////////////////////////////////////// //// //// //// XTEA IP Core //// //// //// //// This file is part of the xtea ...
// (c) Copyright 1995-2017 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> #pragma comment(linker, /STACK:102400000,102400000 ) using namespace std; const int INF = 0x3f3f3f3f; template <typename X> inline bool minimize(X& p, X q) { if (p <= q) return 0; p = q; return 1; } template <typename X> inline bool maximize(X& p, X q) { if (p >...
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 3; vector<int> adj[MAXN]; int sz[MAXN], rt = -1, ok[MAXN], k; int dfs1(int u, int p) { for (int i = 0; i < adj[u].size(); i++) if (adj[u][i] != p) sz[u] += dfs1(adj[u][i], u); return sz[u]; } pair<int, int> dfs2(int u, int ...
#include <bits/stdc++.h> using namespace std; char str[2000 + 5][2000 + 5]; int v, res, n, m, k, cnt; int main() { scanf( %d%d%d , &n, &m, &k); bool flag = 0; if (k == 1) flag = 1; for (int i = 1; i <= n; i++) scanf( %s , str[i]); for (int i = 1; i <= n; i++) { for (int j = 0; j < m; j...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 14:03:51 02/23/2015 // Design Name: // Module Name: HCORDIC_Pipeline // Project Name: // Target Devices: // Tool versions: // Description: // /...
/* * 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 INF = 1e9, MOD = INF + 7; const int N = 1e5 + 5; int n, a[N], nxt[N], lucky[N]; struct Node { int mn = INF, cnt = 0, idx = -1, lazy = 0; } seg[4 * N]; int doLuck(int i, int x) { if (x > 1e4) return i; if (x) lucky[i] = x, i++; i...
// -- (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 property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); long long arr[41] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8092, 16184, 32368, ...
#include <bits/stdc++.h> using namespace std; const int N = (int)1e6 + 100; const long long INF = 9 * (long long)(1e18); const long double PI = 3.14159265358979323846; long long int modexp(long long int x, long long int y, long long int p) { long long int res = 1; x = x % p; if (y == 0) retu...
/* * 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 = 5e5 + 20; long long n, m, k; long long col[N]; vector<long long> g[N]; struct edge { long long u, v; } e[N]; long long ans; long long dead[N]; map<pair<long long, long long>, bool> vis; map<pair<long long, long long>, vector<pai...
#include<bits/stdc++.h> using namespace std; #define FOR(i, a, b) for(int i = (a); i < (b); ++i) #define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i) #define REP(i, N) FOR(i, 0, N) #define RREP(i, N) RFOR(i, N, 0) #define FILL(A,value) memset(A,value,sizeof(A)) #define endl n #define ALL(V...