Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <string>
//#include <cstdio>
using namespace std;
void Fill(int w, int h, string &str, char grid[][51])
{
int i = 0, j = 0;
int move_i = 0, move_j = 1;
int L = -1, U = -1, R = w, D = h;
#include <iostream>
#include <string>
//#include <cstdio>
using namespace std;
struct team_type{
bool problem_AC[13] = {0};
}team[101];
struct problem_type{
#include <cstdio>
#include <algorithm>
using namespace std;
char pic[51][51];
int w, h;
void DFS_X(int, int);
void DFS_pixel (int i, int j, int &dots)
{
if (pic[i][j] == 'X') {
#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--){
#include <cstdio>
#include <algorithm>
using namespace std;
double a0,an1,c[3010];
int Case, N;
double sum_c()
{
double sum = 0;
#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;
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int Case, k;
scanf("%d",&Case);
while (Case--){
scanf("%d",&k);
k = abs(k);
#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;
#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){
#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};