This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define ALL(e) e.begin(), e.end() | |
#define RALL(e) e.rbegin(), e.rend() | |
#define mp(a, b) make_pair(a, b) | |
#define pb push_back | |
#define dbg(x) (cerr << #x << ":" << x) | |
#define mid (l + r) / 2 | |
#define fi first | |
#define sc second | |
#define N 1000000009 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://www.lightoj.com/volume_showproblem.php?problem=1112 | |
#include <bits/stdc++.h> | |
#define ALL(e) e.begin(), e.end() | |
#define pb push_back | |
#define dbg(x) (cerr << #x << ":" << x) | |
#define fi first | |
#define sc second | |
#define N 1003 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define pb push_back | |
#define fi first | |
#define sc second | |
#define inf 1000000000000000LL | |
#define MP make_pair | |
#define min3(a,b,c) min(a,min(b,c)) | |
#define max3(a,b,c) max(a,max(b,c)) | |
#define dbg(x) cerr<<#x<<":"<<x<<endl | |
#define N 100005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
int n, w = 0, c = 0; | |
scanf("%d", &n); | |
for(int i=0; i<n/2; i++){ | |
char x; | |
scanf("%c", &x); | |
if(x == 'W') | |
w++; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <climits> | |
using namespace std; | |
typedef long long int lli; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
string ltrim(const string &); | |
string rtrim(const string &); | |
void print(int c, int n){ | |
while(n--) | |
printf("%d", c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef long long int lli; | |
lli pwr(lli a, lli b){ | |
if(b == 1) | |
return a; | |
if(b == 0) | |
return 0; | |
lli sub_pwr = pwr(a, b/2); |