C. Sagheer and Nubian Market time limit per test  2 seconds memory limit per test  256 megabytes   On his trip to Luxor and Aswan, Sagheer went to a Nubian market to buy some souvenirs for his friends and relatives. The market has some strange rules.…
B. Sagheer, the Hausmeister time limit per test  1 second memory limit per test  256 megabytes   Some people leave the lights at their workplaces on when they leave that is a waste of resources. As a hausmeister of DHBW, Sagheer waits till all studen…
C - Sagheer and Nubian Market 思路: 二分: 代码: #include <bits/stdc++.h> using namespace std; #define maxn 1000005 #define ll long long ll n,s,ai[maxn],ci[maxn]; inline void in(ll &now) { ; ') Cget=getchar(); +Cget-',Cget=getchar(); } int main() { ;i&…
题目描述: Sagheer and Nubian Market time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On his trip to Luxor and Aswan, Sagheer went to a Nubian market to buy some souvenirs for his friends and re…
Sagheer and Nubian Market CodeForces - 812C 题意:n个货物,每个货物基础价格是ai. 当你一共购买k个货物时,每个货物的价格为a[i]+k*i. 每个货物只能购买一次.给你s金币,问你最多可以购买多少个货物,这些货物的最小花费. 题解: 直接二分(1~n)购买数量,每次二分都对每个货物计算价格a[i]+mid*i. 结构体对价格排序,mid个货物总价格大于s的时候break并往小二分,否则往大二分. 数据类型开long long. #include <…
来自FallDream的博客,未经允许,请勿转载,谢谢. 有毒的一场div2 找了个1300的小号,结果B题题目看错没交  D题题目剧毒 E题差了10秒钟没交上去. 233 ------- A.Sagheer and Crossroads 有一个十字路口,分别给出每个方向左右转和直行以及行人的红绿灯的状态,求有没有可能有行人会被车撞 大判断.  附上大佬@ACMLCZH的代码 #include <cstdio> #include <cstring> ][]; inline int…
C. Sagheer and Nubian Market time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On his trip to Luxor and Aswan, Sagheer went to a Nubian market to buy some souvenirs for his friends and relat…
A. Sagheer and Crossroads time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sagheer is walking in the street when he comes to an intersection of two roads. Each road can be represented as two…
A. Sagheer and Crossroads time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sagheer is walking in the street when he comes to an intersection of two roads. Each road can be represented as two…
A Sagheer and Crossroads 水题略过(然而被Hack了 以后要更加谨慎) #include<bits/stdc++.h> using namespace std; int main() { //freopen("t.txt","r",stdin); int a[4][4]; //memset(a,0,sizeof(a)); for(int i=0;i<4;i++) for(int j=0;j<4;j++) scanf(&…