diff --git a/1151D - Stas and the queue at the buffet b/1151D - Stas and the queue at the buffet new file mode 100644 index 0000000..ddee0b7 --- /dev/null +++ b/1151D - Stas and the queue at the buffet @@ -0,0 +1,46 @@ + #include + #include + #include + #include + + + using namespace __gnu_pbds; + using namespace std; + typedef long long unsigned llu; + typedef long long ll; + typedef pair ii; + typedef vector vl; + + //use as vector v; + #define ff(a,b) for(ll i=a; i>n; + //int ar[100005]; + int a[100005]; + int b[100005]; + vector < pair > v; + for(int i=0;i>a[i]>>b[i]; + ans+=b[i]*n-a[i]; + v.pb(mp(a[i]-b[i],i)); + } + sort(v.begin(),v.end()); + + + + for(int i=0;i +#include +#include +#include + + +using namespace __gnu_pbds; +using namespace std; +typedef long long unsigned llu; +typedef long long ll; +typedef pair ii; +typedef vector vl; + +//use as vector v; +#define ff(a,b) for(ll i=a; i>n; + cin>>ar; + int len=ar.length()-1; + for(int i=0;i