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> | |
using namespace std; | |
int main() | |
{ | |
int M,N; | |
scanf("%d", &M); | |
while (M--) { | |
scanf("%d", &N); | |
int ans[1001],nOfans = 0, sum = 0; | |
for (int i = 2; sum + i <= N; 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> | |
#include <cmath> | |
using namespace std; | |
typedef unsigned int uint; | |
int main() | |
{ | |
uint n; | |
while (scanf("%u",&n)){ | |
if (!n) break; | |
uint a = sqrt(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 <cstdio> | |
using namespace std; | |
int gcd(int a, int b) | |
{ | |
while (b){ | |
int temp = a % b; | |
a = b; | |
b = temp; | |
} | |
return a; |
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> | |
using namespace std; | |
int main() | |
{ | |
int N,B; | |
while (scanf("%d%d",&N,&B) != EOF){ | |
double digit = 0; | |
int factor[801] = {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 <cmath> | |
using namespace std; | |
int main() | |
{ | |
int prime[80000]; | |
int nOfprime = 2; | |
prime[0] = 2; | |
prime[1] = 3; | |
for (int i = 5, gap = 2; i <= 1000000; i += gap, gap = 6-gap){ |
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> | |
using namespace std; | |
int main() | |
{ | |
int B, A, S; | |
while (scanf("%d%d%d", &B, &A, &S) != EOF){ | |
int carry = 0, len = 0, x = A; | |
while (1){ | |
int tmp = x * S + carry; | |
carry = tmp / B; |
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> | |
using namespace std; | |
int main() | |
{ | |
int Case, k; | |
scanf("%d",&Case); | |
while (Case--){ | |
scanf("%d",&k); | |
k = abs(k); |
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> | |
using namespace std; | |
typedef long long int llt; | |
int main() | |
{ | |
// freopen ("input.txt","rt",stdin); | |
int H,W; | |
while (scanf("%d%d",&H,&W) != EOF){ | |
if (!H && !W) break; |
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 <algorithm> | |
using namespace std; | |
double a0,an1,c[3010]; | |
int Case, N; | |
double sum_c() | |
{ | |
double sum = 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 <cmath> | |
using namespace std; | |
int main() | |
{ | |
double B, H; | |
const double pi = 2 * asin(1); | |
int Case; | |
scanf("%d", &Case); | |
while (Case--){ |