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
var arr = [03,01,00,170,25,01]; | |
var dem = 00; | |
arr.forEach(function(e) { | |
dem ^= e; | |
}, this); | |
console.log("answer:" + dem.toString(16)); |
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<stdio.h> | |
#include<stdlib.h> | |
#include<conio.h> | |
#include<malloc.h> | |
#include<string.h> | |
struct entry{ | |
char name[50]; | |
char nick[50]; | |
char email[50]; |
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
log | |
$ heroku local | |
[WARN] No ENV file found | |
11:01:03 AM web.1 | Your server is now running... | |
11:01:03 AM web.1 | 5000 | |
11:01:07 AM web.1 | GET request received at / | |
11:01:09 AM web.1 | <!DOCTYPE html> | |
11:01:09 AM web.1 | <html> | |
11:01:09 AM web.1 | <head> |
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
app.get('/',function(req,res){ | |
console.log(req.method+" request received at "+req.url); | |
request({ | |
url:"https://sc.productrx.com/public/", | |
method:"GET", | |
qs:{resource:"schema",data_type:"JSON"} | |
},function(err,response,body){ |
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[] codefightsTournament(int p, int s) { | |
return new int[] {(int)(Math.pow(0.5,p)*4000),p==1?2*s:s}; | |
} |
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 countSumOfTwoRepresentations2(int n, int l, int r) { | |
if (l==r){ return l*2==n?1:0;} | |
int c = r-n/2 >= n/2-l ? l: r; | |
if (n/2<=l||n/2>=r) return 0; | |
int t=0; | |
if(n%2==0) t=1; | |
return Math.abs(n/2-c)+t; | |
} |
NewerOlder