This file contains hidden or 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 <iostream> | |
#include <queue> | |
#include <vector> | |
#include <sstream> | |
using namespace std; | |
typedef pair<int, int> P; | |
typedef vector<vector<int> > matrix; |
This file contains hidden or 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
package test; | |
import java.util.Scanner; | |
public class Test { | |
private final static int HIGHEST = 8; | |
public static void main(String[] args) { | |
int[] bits = new int[HIGHEST]; |
This file contains hidden or 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
package test; | |
public class Main { | |
public static void main(String[] args) { | |
byte x = 0; | |
for (int i = 0; i < 8; i++) { | |
x |= 1 << i; | |
} | |
System.out.println(x); |
This file contains hidden or 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 <cstdio> | |
int main() { | |
int n,ans=0,t=0,i; | |
bool flag = true; | |
while(scanf("%d",&n)==1){ | |
if(n==0&&!flag)break; | |
if(n==0){ | |
printf("%d\n",ans-t); | |
ans=0; |
This file contains hidden or 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 <cstdio> | |
#include <cstdlib> | |
#include <algorithm> | |
using namespace std; | |
int a[16],d[1<<16][16]; | |
const int INF = (int)1e8; | |
int main() { | |
int k,t,n,ans; | |
scanf("%d",&n); | |
for(int i=0;i<n;i++)scanf("%d",a+i); |
This file contains hidden or 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 <cstdio> | |
struct Tp { | |
int h,m,s; | |
bool operator < (const Tp& x)const{ | |
if(h==x.h){ | |
if(m==x.m)return s<x.s; | |
else return m<x.m; | |
}else return h<x.h; | |
} | |
Tp operator - (const Tp& x){ |
This file contains hidden or 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; | |
int main() { | |
int n, m; | |
while(scanf("%d%d", &n, &m)==2) { | |
bool flag = true; | |
int a, b; | |
set<int> M[10001]; | |
vector<int> W[10001]; |
This file contains hidden or 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; | |
typedef long long LL; | |
const int maxn = 1000005; | |
int a[maxn],f[maxn]; | |
int main() { | |
int T, n; | |
scanf("%d", &T); | |
while(T--) { | |
scanf("%d", &n); |
This file contains hidden or 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; | |
typedef long long LL; | |
const int maxn = 102; | |
struct P { | |
int r, c; | |
P() {} | |
P(int R, int C):r(R), c(C){} | |
}; |
This file contains hidden or 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 <cstdio> | |
#include <cmath> | |
const double eps = 1e-5; | |
double f(double x) { | |
return pow(2, abs(x)); | |
} | |
double trinary_search(double l, double r) { | |
double t1,t2,a1,a2; |
NewerOlder