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 <algorithm> | |
// you can write to stdout for debugging purposes, e.g. | |
// cout << "this is a debug message" << endl; | |
int solution(vector<int> &A) { | |
// write your code in C++11 | |
vector<int> keep; | |
for(vector<int>::iterator it=A.begin(); it!= A.end() ; ++it){ |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style> | |
#div1 {width:70px;height:70px;padding:10px;border:1px solid #aaaaaa;} | |
#div2 {width:70px;height:70px;padding:10px;border:1px solid #aaaaaa;} | |
#div3 {width:70px;height:70px;padding:10px;border:1px solid #aaaaaa;} | |
#div4 {width:70px;height:70px;padding:10px;border:1px solid #aaaaaa;} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Regex Tester</title> | |
<!-- Bootstrap --> |
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
int solution(int X, vector<int> &A) { | |
vector<bool> count(100001); | |
long long sum = 0; | |
long long x = X; | |
long long exp = x*(x+1)/2; | |
for(int i=0;i<(int)A.size();i++){ | |
if( A[i] <= X && count[ A[i] ] == false) { | |
count[A[i]] = true; | |
sum+= A[i]; | |
if(sum == exp) return 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
int solution(vector<int> &A) { | |
// write your code in C++11 | |
vector<int> B(100002); | |
int N = A.size(); | |
int flag = 1; | |
for(int i=0;i<N;i++){ | |
if(A[i] <= N){ | |
if(B[A[i]] > 0){ flag = 0; break;} | |
B[ 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
int solution(vector<int> &A) { | |
// write your code in C++11 | |
int N = A.size(); | |
long long sum = 0; | |
for(int i=0;i<N;i++){ | |
sum+=A[i]; | |
} | |
long long expected = (long long)(N+1)*(long long)(N+1 + 1)/2; | |
int output = expected - sum; | |
return output; |
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 S, c = 1; | |
while(scanf("%d", &S), S>= 0){ | |
int problems[15], need[15]; | |
problems[0] = S; | |
for(int i=1;i<=12;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
private Point[][] Buildings = new Point[50][50]; | |
{ | |
Buildings[AGAPE][0] = new Point(-7.787122, 110.377872); | |
Buildings[AGAPE][1] = new Point(-7.787192, 110.378326); | |
Buildings[AGAPE][2] = new Point(-7.786715, 110.378402); | |
Buildings[AGAPE][3] = new Point(-7.786641, 110.377947); | |
Buildings[BIBLOS][0] = new Point(-7.786243, 110.378112); | |
Buildings[BIBLOS][1] = new Point(-7.786268, 110.378268); |
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
// you can also use includes, for example: | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int solution(vector<int> &A) { | |
// write your code in C++98 | |
for(int i=1;i<(int)A.size();i++){ | |
A[i] = A[i-1] + 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
import java.util.*; | |
class BuildingCheck{ | |
static final double EPS = 1e-9; | |
static class point implements Comparable<point>{ | |
double x, y; // only used if more precision is needed | |
point() { x = y = 0.0; } // default constructor | |
point(double _x, double _y) { x = _x; y = _y; } // user-defined | |
// use EPS (1e-9) when testing equality of two floating points |
NewerOlder