2010-02-12から1日間の記事一覧

12問目

#include <iostream> #include <math.h> using namespace std; int main(){ int sq=0; int count=0; int prv=0; for(long long int i=1;i<100000000000000000;i++) { sq+=i; if( sqrt((double)sq) - floor(sqrt((double)sq))==0.0) count--; for(int n=1; n<=sq; n++ ) { if(sq</math.h></iostream>…

11問目

斜めって2方向あるんですよ奥さん。 In the 2020 grid below, four numbers along a diagonal line have been marked in red.08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81…

第10問

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million. #include <iostream> #include <math.h> using namespace std; long long int prime[1000000]; long long int table[100000000]; int primeCall(){ int flag=0; prim</math.h></iostream>…