Codeforces Round #515 (Div. 3)

Source: Internet
Author: User
Tags acos gcd cmath

Codeforces Round #515 (Div. 3)
1#include <bits/stdc++.h>2#include <iostream>3#include <cstdio>4#include <cstdlib>5#include <cstring>6#include <cmath>7#include <algorithm>8#include <queue>9#include <vector>Ten#include <map> One #defineLson i<<1 A #defineRson i<<1|1 - #defineLS L,mid,lson - #defineRS Mid+1,r,rson the #defineMem (a,x) memset (A,x,sizeof (a)) - #defineGCD (A, B) __gcd (A, B) - #definell Long Long - #defineull unsigned long Long + #defineLowbit (x) (x&-x) - #definePB (x) push_back (x) + #defineENLD Endl A #defineMian Main at #defineITN int - #definePrinft printf - #pragmaGCC Optimize (2) - //#pragma COMMENT (linker, "/stack:102400000,102400000") -  - Const DoublePI = ACOs (-1.0); in Const intINF =0x3f3f3f3f; - Const intEXP = 1e-8; to Const intN = 1e5 +5; + Const intMOD = 1e9 +7; - Const intMAXN =505; the  * using namespacestd; $ Panax Notoginseng /* - 4 the Ten 2 3 7 +  the A 1234 1 199 the 1000000000 1 1 1000000000 + */ - intN,l,v,l,r; $ intMain () { $Std::ios::sync_with_stdio (false); - Cin.tie (NULL); -  the      while(cin>>N) { -          while(n--) {WuyiCin>>l>>v>>l>>R; thecout<<l/v-(r/v-(l1)/V) <<Endl; -         } Wu     } -}
A-vova and Train

1#include <bits/stdc++.h>2#include <iostream>3#include <cstdio>4#include <cstdlib>5#include <cstring>6#include <cmath>7#include <algorithm>8#include <queue>9#include <vector>Ten#include <map> One #defineLson i<<1 A #defineRson i<<1|1 - #defineLS L,mid,lson - #defineRS Mid+1,r,rson the #defineMem (a,x) memset (A,x,sizeof (a)) - #defineGCD (A, B) __gcd (A, B) - #definell Long Long - #defineull unsigned long Long + #defineLowbit (x) (x&-x) - #definePB (x) push_back (x) + #defineENLD Endl A #defineMian Main at #defineITN int - #definePrinft printf - #pragmaGCC Optimize (2) - //#pragma COMMENT (linker, "/stack:102400000,102400000") -  - Const DoublePI = ACOs (-1.0); in Const intINF =0x3f3f3f3f; - Const intEXP = 1e-8; to Const intN = 1e5 +5; + Const intMOD = 1e9 +7; - Const intMAXN = 2e5+5; the  * using namespacestd; $ Panax Notoginseng /* - 8 the L 1 + R 2 A R 3 the ? 2 + L 4 - ? 1 $ L 5 $ ? 1 - */ - intN; the CharC; - intIND;Wuyi intA[MAXN]; the intMain () { -     //Std::ios::sync_with_stdio (false); Wu     //Cin.tie (NULL); -  About      while(cin>>N) { $         intL=0, r=1; -Mem (A,0); -          while(n--) { -Cin>>c>>IND; A             if(c=='L') { +a[ind]=l--; the}Else if(c=='R') { -a[ind]=r++; $}Else { the                 //cout<<a[ind]<< ' <<a[l+1]<< ' <<l+1<<endl; theCout<<min (a[ind]-(l +1), R1-a[ind]) <<Endl; the             } the         } -  in     } the}
c-books Queries

Codeforces Round #515 (Div. 3)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.