Skip to content

Instantly share code, notes, and snippets.

#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);
#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;
@psychicalcoder
psychicalcoder / Main.java
Created December 16, 2017 15:40
overflow example
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);
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];
#include <iostream>
#include <queue>
#include <vector>
#include <sstream>
using namespace std;
typedef pair<int, int> P;
typedef vector<vector<int> > matrix;