Source stringclasses 1
value | Date int64 2.01k 2.02k | Text stringlengths 22 783k | Token_count int64 20 394k |
|---|---|---|---|
Project_CodeNet | 2,020 | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cstdio>
#include<cmath>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
int MOD=1000000007;
signed main(){
int n... | 460 |
Project_CodeNet | 2,020 | #include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <iterator>
#include <algorithm>
#include <cfenv>
#include <random>
#include <numeric>
#include <cmath>
#i... | 491 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define REP(i,n) for(ll i=0;i<(n);++i)
using namespace std;
typedef long long ll;
// dp[i][j]: 左にi個、右にj個詰めた時の最大値
ll dp[2020][2020];
int main() {
int N;
cin >> N;
vector< pair<ll, ll> > A(N);
REP(i,N) {
cin >> A[i].first;
A[i].second = i;
}
sort(A.begin(), A.end(), greater<... | 287 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
ll res[2010];
ll dp[2010][2010];
int main()
{
cin >> N;
vector<pair<ll, int>> a(N);
for(int i = 0; i < N; i++)
{
ll A;
cin >> A;
a[i] = make_pair(A, i);
}
sort(a.begin(),a.end(), [](pair<ll,... | 326 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
long long N;
// active, index
vector<pair<long long, long long> >vec;
// left, right
long long dp[2005][2005];
int main(){
cin >> N;
for(long long i = 0; i < N; i++) {
long long a;
cin >> a;
vec.push_back(make_pair(a, i));
}
sort(vec.begin(), vec... | 314 |
Project_CodeNet | 2,020 | /*************************************************************************
>>> Author: WindCry1
>>> Mail: lanceyu120@gmail.com
>>> Website: https://windcry1.com
>>> Date: 12/30/2019 11:03:37 PM
*************************************************************************/
//#pragma GCC optimize(2)
//#pragma GCC diagnostic ... | 693 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define loop(i, a, b) for(li i=a; i<=b; i++)
#define stuff ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
typedef long long li;
ty... | 770 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>
using namespace std;
using namespace boost;
using namespace boost::adaptors;
int main() {
int64_t n;
cin >> n;
vector<int64_t> a(n);
priority_queue<pair<int64_t, int64_t>> q;
for (auto&& aa : a | index... | 290 |
Project_CodeNet | 2,020 | /*
, \ / ,
/ \ )\__/( / \
/ \ (_\ /_) / \
____/_____\__\@ @/___/_____\____
| |\../| |
| \VV/ |
| ------hoi------- |
|_________________________________|
| /\ / \\ \ /\ ... | 573 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& ... | 677 |
Project_CodeNet | 2,020 | // to check whether testcodes correct
// copy from https://atcoder.jp/contests/abc163/submissions/13011784
/*Bismillahir Rahmanir Rahim*///{
#include <bits/stdc++.h>
#include <ext/numeric>
using namespace std; using __gnu_cxx::power;
using ll = long long; using ull = unsigned long long; using ld = long double;
const ll... | 868 |
Project_CodeNet | 2,020 | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename ... | 499 |
Project_CodeNet | 2,020 | #include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <un... | 482 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define SZ(x) (int)(x.size())
using ll = long long;
using ld = long double;
const ld eps = 1e-9;
const ll MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template <typename T1, typename T2>
void chmax(T1 &a, const T2 &b) {
if(a < b) a = b;
}
te... | 559 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef uns... | 558 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second... | 702 |
Project_CodeNet | 2,020 | #pragma region Macros
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_typ... | 759 |
Project_CodeNet | 2,020 | //g++ 5.4.0
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll N; cin>>N;
vector<pair<ll,ll>> v;
ll dp[N + 1][N + 1];
memset(dp,0,sizeof(dp));
for(ll i=0;i<N;++i)
{
... | 343 |
Project_CodeNet | 2,020 | #include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef double db;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int n;... | 371 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = ... | 396 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin(... | 431 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#def... | 610 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<pair<int, int> > a;
a.resize(n);
for(int i = 0; i < n; ++i) {
cin >> a[i].first;
a[i].second = i;
}
sort(a.begin(), a.end(), greater<pair<int, int> > ());
vector<vector<... | 327 |
Project_CodeNet | 2,020 | #include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <bitset>
#include <numeric>
#include <cassert>
#include <array>
#inc... | 1,206 |
Project_CodeNet | 2,020 | // RAKSHIT KADAM
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int , null_type , less<int> , rb_tree_tag , tree_order_statistics_node_update>
#warning !!!check the size of arrayss!!!
#def... | 705 |
Project_CodeNet | 2,020 | #include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
#include <cassert>
#include <n... | 593 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef long long ll;
typedef pair<ll, ll> P;
P baby[2000] = {};
ll dp[2001][2001] = {};
int main(){
ll n, i, j;
cin >> n;
for(i=0; i<n; i++){
baby[i].second = i+1;
cin >> baby[i].first;
}
sort(baby, baby+n, great... | 371 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=2e3+5;
pii a[N];
ll dp[N][N];
void init();
void work();
int ca=1;
int main(){
// freopen("in.txt","r",stdin);
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
// init();
// int T;cin>>T;
// wh... | 288 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll maxINT = 1000000000000000000;
int main (){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll N;
cin >> N;
vector<pair<ll,ll>> v(N+1);
for(int i = 1 ; i < N+1; ++i){
ll a;
cin >> a;
v[i] = make_pa... | 362 |
Project_CodeNet | 2,020 | bool DBG = false;
#include<bits/stdc++.h>
//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
using ld = long double;
//using i128 = __int128_t;
//using bint = boost::multiprecision::cpp_int
//using d1024 = boost::multiprecision::n... | 1,144 |
Project_CodeNet | 2,020 | #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
... | 480 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;
#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define endl "\n"
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int N;... | 407 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> p... | 1,120 |
Project_CodeNet | 2,020 | #define __mode_debug__
/* ξ
ll
_ll_
/ ∞ \
│* A *│
│* C *│
│* 祈 *│
│* 願 *│
│* *│
 ̄ ̄ ̄ ̄ ̄ */
//C++14 (GCC 5.4.1)
#include <bits/stdc++.h>
using namespace std;
#ifdef __mode_debug__
#define DBG
#else
#define DBG if(false)
#endif
#define LLINF (1LL<<60)
using ll = long long;
#define mod... | 1,434 |
Project_CodeNet | 2,020 | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author aajisaka
*/
#include<bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
cerr << " " << to_string(H);
debug_out(T.... | 590 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()
const int INF = 100000002;
inline bool chmax(ll&x,ll y);
ll dp[20... | 347 |
Project_CodeNet | 2,020 | #include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#in... | 561 |
Project_CodeNet | 2,020 | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <map>
#include<vector>
#include<queue>
#include<bits/stdc++.h>
#define debug(x) cout <<#x<<" = "<<x<<endl
#define debug2(x, y) cout<<x<<" "<<y<<endl
#define gg cout <<"---------------QAQ---------------"<<endl
#define fi first
#define... | 611 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>
void chmax(T &x, T y) { if (x < y) x = y; }
const int N = 2010;
ll dp[N][N];
int main() {
int n;
cin >> n;
vector<pair<ll, int>> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i].first;
a[i].second = i... | 297 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pi pair<ll,ll>
#define endl "\n"
using namespace std;
const ll N=500010;
ll n;
vector<pi> ar;
ll dp[2010][2010];
ll func(ll i,ll j)
{
if(i>j){return 0;}
... | 289 |
Project_CodeNet | 2,020 | #include <cstdio>
#include <stdlib.h>
#include <ctype.h>
#include <cstring>
#include <math.h>
#include <limits.h>
typedef struct {
long long int A;
long long int number;
} person;
int cmpnum(const void * n1, const void * n2)
{
if (*(long long *)n1 < *(long long *)n2)
{
return 1;
}
else ... | 787 |
Project_CodeNet | 2,020 | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>... | 491 |
Project_CodeNet | 2,020 | #include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <ra... | 860 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'
typedef long long ll;
typedef pair<int,int> pii;
typedef... | 467 |
Project_CodeNet | 2,020 | /// Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f0(n) for(int i=0;i<n;i++)
#define ms(x) memset(x,0,sizeof(x))
#define ins insert
#define ALL(v) v.begin(),v.end()
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x... | 1,015 |
Project_CodeNet | 2,020 | #include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<ll , ll> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair... | 667 |
Project_CodeNet | 2,020 | #include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
using namespace std;
#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll... | 955 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#define pb push_back
#define ef(i,u) for(int i=b[u];i;i=nxt[i])
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define per(i,b,a) for(int i=b;i>=a;--i)
#define gcd(a,b) __gcd(a,b)
#define MEM(a,x) memset(a,x,sizeof(a))
#define VI vector<int>
#define PII pair<int,int>
#define ull unsigned long long
#de... | 419 |
Project_CodeNet | 2,020 | // WeirdBugsButOkay
# include <bits/stdc++.h>
# define ll long long
# define ld long double
# define pii pair <int,int>
# define pll pair <ll,ll>
# define mp make_pair
# define pb push_back
# define ff first
# define ss second
# define endl '\n'
using namespace std;
ll pow3(ll a, ll b, ll m = 1000000007)
{
ll r... | 660 |
Project_CodeNet | 2,020 | #pragma GCC optimize(2)
#pragma G++ optimize(2)
#include<bits/stdc++.h>
#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define ss(a) scanf("%s",a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i,a,b) for(register int i=a;i<=b;++i)
#define repd(i,a,b) for(register int i=a;i>... | 420 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define repr(i,b,a) for(int i=int(b);i>=(a);i--)
#define all(x) x.begin(),x.end()
const ll mod = 1e9+7;
const ll INF = 1e9;
ll gcd... | 479 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;
const int maxN = 2e3; int n;
lli a[maxN];
vector<pair<lli, int>> all;
lli memo[maxN][maxN];
lli solve(int i = 0, int lo = 0, int hi = n - 1)
{
if (i == n) return 0;
if (memo[lo][hi] != -1) retur... | 347 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
#define _rrep(i,n) _rrange(i,0,n)
#define _rrange(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);--i)... | 1,502 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo... | 739 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
const int N = 2005;
pair<int, int> a[N];
int n;
long long dp[N][N];
long long f(int x, int l) {
if (x == n) return 0LL;
if (~dp[x][l]) return dp[x][l];
int r = n - (x-l) - 1;
return dp[x][l] = max(
1LL * a[x].first * abs(a[x].second - l) + f(x+1, l+1),
1... | 248 |
Project_CodeNet | 2,020 | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <set>
#include <deque>
#include <map>
#define INF 100000000
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;
using P... | 1,772 |
Project_CodeNet | 2,020 | #include "bits/stdc++.h"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/operators.hpp>
#include <boost/dynamic_bitset.hpp>
namespace adaptor = boost::adaptors;
using index_t = std::... | 419 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int main(){
int i,j,k,N;
cin >> N;
vector<pair<long long,long long>> A(N);
for(i=0; i<N; i++){
cin >> A.at(i).first;
A.at(i).second = i;
}
sort(A.begin(),A.end(),greater<>());
vector<vector<long long>> ans(N+1,vector<long lon... | 301 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using f64 = double;
using f80 = long double;
#define FOR(v, a, b) for(i64 v = (a); v < (b); ++v)
#define FORE(v, a, b) for(i64 v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#defi... | 901 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
const int64_t INF = 1LL << 60;
template <typename T>
bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
vector<pair<int, int>> P(N);
for (int ... | 347 |
Project_CodeNet | 2,020 | // created by mtnshh
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A) cout<<i... | 630 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
#define int long long
#define inf 1000000007
#define pa pair<int,int>
#define ll long long
#define pal pair<double,double>
#define ppap pair<pa,int>
#define PI 3.14159265358979323846
#define paa pair<int,char>
#define mp make_... | 1,958 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
const int mx=2077;
ll dp[mx][mx];
int main() {
cin.tie(0); co... | 565 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll N;
cin >> N;
vector<pair<ll,ll>> A(N);
for(ll i=0; i<N; ++i) {
cin >> A[i].first;
A[i].second = i;
}
sort(A.begin(), A.end());
reverse(A.begin(), A.end());
ve... | 293 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define dofloat cout<<fixed<<setprecision(8)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define bitcount __builtin_popcount
#define all(vec) vec.begin(),vec.end()
#define rall(vec) vec.rbegin(),vec... | 774 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); rit... | 419 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_... | 609 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;
int main() {
ll n;
cin >> n;
vector<pll> a(n);
for(ll i=0;i<n;i++) {
ll tmp;
cin >> tmp;
a... | 283 |
Project_CodeNet | 2,020 | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
typedef long long ll;
const ll MOD = 1e9 + 7;
const long long INF = 1LL<<60;
const ll NMAX = 2010;
using namespace std;
ll dp[NMAX+3][NMAX+3];
int main(){
ll n;
cin >> n;
vector<pair<ll, int> > a... | 371 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define pb push_back
#define csl ios_base::sync_with_stdio(false); cin.tie(NULL)
#define reps(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) for(int i=0;i<int(b);i++)
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int,int... | 360 |
Project_CodeNet | 2,020 | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <functional>
#include <numeric... | 631 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int, int>;
using pll = pair<int, int>;
using Edge = pair<int, ll>;
using Graph = vector<vector<int>>;
using WeightedGraph = vector<vector<Edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MO... | 338 |
Project_CodeNet | 2,020 | #include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stri... | 591 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll mod = 1000000007;
int main() {
int N;
cin >> N;
vector<ll> A(N);
rep(i, N) cin >> A[i];
vector<vector<ll> > dp(N + 1, vector<ll>(N + 1, 0));
vector<P> p;
... | 371 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
void solve(std::istream &in, std::ostream &out);
int main() {
#ifdef LOCAL
freopen("../IO/e.in", "r", stdin);
// freopen("../IO/f.out", "w", stdout);
#else
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
#endif
solve(std::c... | 426 |
Project_CodeNet | 2,020 | #include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>
#define MOD (1000000007)
using namespace std;
typedef long lo... | 346 |
Project_CodeNet | 2,020 | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator... | 803 |
Project_CodeNet | 2,020 | #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(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
... | 736 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;
using Graph = vector<vector<ll>>;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, ... | 515 |
Project_CodeNet | 2,020 | #include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template<class T> constexpr... | 455 |
Project_CodeNet | 2,020 | // warm heart, wagging tail,and a smile just for you!
// ███████████
// ███╬╬╬╬╬╬╬╬╬╬███
// ███╬╬╬╬╬████╬╬╬╬╬╬███
// ... | 2,702 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define fi first
#define sd second
#define lson (nd<<1)
#define rson (nd+nd+1)
#define PB push_back
#define mid (l+r>>1)
#define MP make_pair
#define SZ(x) (int)x.size()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef pair<int,int>... | 455 |
Project_CodeNet | 2,020 | #include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
int main() {
int n; cin >> n;
int A[n]; for (int i = 0; i < n; i++) cin >> A[i];
vector<pair<int, int> > x;
for (int i = 0; i < n; i++) x.push_back({A[i], i});
sort(x.rbegin(), x.rend());
long long d... | 400 |
Project_CodeNet | 2,020 | #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
const int MAXN = 2001;
std::vector<std::pair<int, int>> a;
int64_t f[MAXN][MAXN];
int64_t solve(int n) {
std::sort(a.begin(), a.end(), [](const auto& x, const auto& y) {
return x > y;
});
for (int i = 0; i < n; ++i) {
int64_... | 374 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
template <typename T> void print(T t) { cout<<t<<endl; }
template<typename T, typename... Args> void print(T t, Args... args) { cout<<t<<" "; print(args...); }
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define int long long
#define ... | 291 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b){if(a < b){a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b){if(a > b){a = b; return 1;} return 0;}
using ll = long long;
using P = pair<int,int>;
using pl... | 311 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_bac... | 473 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
const int N = 2005;
ll M = 1e9 + 7;
ll power(ll x,ll y){ ll res=1; while(y){ if(y&1) res=(res*x)%M; y=y>>1; x=(x*x)%M;} }
ll dp[N][N];
int... | 363 |
Project_CodeNet | 2,020 | //https://atcoder.jp/contests/abc163/tasks/abc163_b
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>
#include <stack>
#include <math.h>
#include <cstdint>
#include <numeric>
#include <... | 3,204 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
void chmax(int64_t& a, int64_t b){
a = max(a, b);
}
int main(){
int N;
cin >> N;
vector<int64_t> A(N);
for(int i=0; i<N; i++) cin >> A[i];
vector<int> order;
for(int i=0; i<N; i++) order.push_back(i);
sort(order.begin(), order.end(), [&](in... | 263 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#defin... | 658 |
Project_CodeNet | 2,020 | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstdint>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <chrono>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#incl... | 795 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define LL long long
typedef pair<int, int> pii;
template< typename T > inline void read(T &x)
{
static char _c;
static bool _f;
x = 0;
_f = 0;
_c = getchar();
while(_c < '0' || '9' < _c) {if(_c == '-') _f = true; _c = getchar();}
while('0' <... | 1,323 |
Project_CodeNet | 2,020 | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Map = map<char,ll>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
ll INF=100000000000000;
int main(){
ll N;
cin >> N;
vector<ll> A(N+1,0);
vector<P> B(N);
for(ll i=0;i<N;i++){
cin>>A[i+... | 350 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 2147483647;
const ll LINF = 9223372036854775807;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
int ma... | 372 |
Project_CodeNet | 2,020 | #include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cassert>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<list>
#include <cstring>
#include <functional>
//#include<unordered_map>
//#include<unordered_set>
using name... | 484 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)... | 752 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MAX 200005
#define INF 1e18
lli n;
lli dp[3000][3000];
vector <pair <lli,lli> > arr;
bool compare(pair <lli,lli> a, pair <lli,lli> b){
if(a.first > b.first)
return true;
else if(a.first == b.first && a.second > b.second)
... | 476 |
Project_CodeNet | 2,020 | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int long long
template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
template <class T>
inline bool chmin(T &a, T b)
{
if (a > b)
{
a = b;
return true;
}
return false;
}
template <class T>
i... | 535 |
Project_CodeNet | 2,020 | #include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
const int N=2003;
int dp[N][N];
int ans;
void cmax(int &x,int y){x=max(x,y);}
int32_t main()
{
#ifndef ONLINE_JUDGE
freopen("in","r",stdin);
freopen("out","w",stdout);
#endif
int n;
cin>>n;
pair<int,int> a[n+1];
for(int i=1;i<=n;i... | 275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.