F1
stringlengths
6
6
F2
stringlengths
6
6
text_1
stringlengths
20
200k
text_2
stringlengths
20
200k
label
int64
0
1
C10132
C10131
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cstdlib> #include <algorithm> #include <string.h> #include <iostream> using namespace std; char dict[100]; char word1[] = {"zyeqejp mysljylc kd kxveddknmc re jsicpdrysirbcpc ypc rtcsra dkh wyfrepkym veddknkmkrkcdde kr kd eoya kw aej tysr re ujdr lkgc jv"}; char word2[] = {"qaozour languag...
0
C10132
C10145
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define For(i, a, b) for (int i = (a); i != b;...
0
C10132
C10147
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
/***************************************************************************** *************************** Macros and Typedefs ***************************** *****************************************************************************/ // #pragma stacksize 1M twice // #pragma comment(linked, "/STACK:16777216") #inc...
0
C10132
C10005
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#pragma once // -- libs includes #include "core/types.h" // ================================================================================================ // Class for managing a sieve for more quickly searching for prime numbers // ===================================================================================...
0
C10132
C10022
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#pragma once // -- libs includes #include "core/types.h" // ================================================================================================ // A class for taking high precision timings // ================================================================================================ class CTimer { ...
0
C10132
C10104
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <memory.h> #include <vector> #include <algorithm> using namespace std; int N, M, D; #define MAX 3010 int SX, SY; bool or[MAX][MAX]; bool original[MAX][MAX]; bool matr[MAX][MAX]; int gcd(int a, int b) { if (a < b) return gcd(b, a); if (b == 0) return a; return gcd(b, a % b); } int...
0
C10132
C10156
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #include<limits.h> #include<ctype.h> #include<iostream> #include<iomanip> #include<sstream> #include<algorithm> #include<functional> #include<vector> #include<string> #include<stack> #include<queue> #include<set> #include<map> #include<complex> #d...
0
C10132
C10327
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define max(x, y) ((x)>(y)?(x):(y)) #define min(x, y) ((x)<(y)?(x):(y)) #define abs(x) ((x)<0?-(x):(x)) char buf[1024]; typedef long long int64; int R, C, D; int pnt_len = 0; typedef struct pnt_s { int r; int c; } pnt_t; pnt_t pnt[10000]; i...
0
C10132
C10085
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <string> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <cstdlib> #include <cstring> #include <cassert> #include <iostream> #include <sstream> #include <cstddef> #include <algorithm> #include <utility> #include <iterator> #include <numeric> #include <list> #include <...
0
C10132
C10084
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <cmath> #define MAXN 105 using namespace std; struct node { int x, y; bool operator<(const node& p) const { return ((x * p.y - y * p.x) < 0); } }; int GetVec (struct node a, struct node b) { return a.x * b.y ...
0
C10132
C10032
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include "stdafx.h"
0
C10132
C10301
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <fstream> #include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> #include <set> #include <sstream> #include <Windows.h> #include <boost/rational.hpp> #include <boost/tokenizer.hpp> using namespace std; class FileReader : public ifstream { public: FileReader( const stri...
0
C10132
C10144
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <algorithm> #include <queue> #include <cmath> #define REP(i,n) for(int i=0; i<(int)(n); i++) inline int getInt(){ int s; scanf("%d", &s); return s; } using namespace std; char g[64][64]; int main(){ int t = getInt(); REP(cc, t){ int h = getInt(); int w = getInt(); int d =...
0
C10132
C10236
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <utility> #include <queue> #include <map> #include <set> using namespace std; typedef long long LL; typedef unsigned int UINT32; vector<pair<int,int> > getMirrors(int r, int c, int H, int W) { vector<pair<int,...
0
C10132
C10298
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <cstdlib> using namespace std; const int DIM_MAX = 35, D_MAX = 55; int H, W, D; int h_scale, w_scale; int you_x, you_y; bool base_grid[DIM_MAX][DIM_MAX]; bool nav_info[3][3]; bool direct_reflection(int dx, int dy) { int cur_x = you_x, cur_y = you_y; int dist = -1; while (!base_gr...
0
C10132
C10255
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <string.h> #include <string> #include <vector> #include <sstream> #include <algorithm> #include <iostream> #include <assert.h> #include <cmath> #include <set> using namespace std; #define FOR(i,n) for (int i = 0; i < n; i++) #define abs(x) ((x)<0?(-(x)):(x)) #define REP(i,v) for (unsigned i...
0
C10132
C10191
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <iostream> #include <cstring> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cmath> #include <algorithm> #define N 1000010 using namespace std; char room[40][40]; int h, w, d; struct Point { int x, y; Point (int _x = 0, int _y = 0) { x ...
0
C10132
C10087
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <vector> #include <utility> #include <set> #include <map> #include <algorithm> #include <limits> #include <sstream> #include <string> #include <numeric> #include <iterator> #include <boost/rational.hpp> using namespace std; using namespace boost; #define PRINT(E)\ do {\ cerr << #E ": "...
0
C10132
C10053
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <set> #include <fstream> #include <string> using namespace std; typedef pair<int, int> pii; namespace { static int GCD(int a, int b) { return b==0 ? a : GCD(b,a%b); } }; int main() { ifstream fin("D-small-attempt0.in"); ofstream fout("D-small-attempt0.out"); unsigned int numberOfCases; fin >> numberOfC...
0
C10132
C10272
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <fstream> #include <cstdio> #include <iomanip> #include <sstream> #include <cstring> #include <string> #include <cmath> #include <stack> #include <list> #include <queue> #include <deque> #include <set> #include <map> #include <vector> #include <algorithm> #include <numeric> #include <utilit...
0
C10132
C10038
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #define SQR(x) ((x) * (x)) inline int sign(int x) { if (x == 0) return 0; if (x > 0) return 1; if (x < 0) return -1; } inline int abs(int x) { if (x > 0) return x; else return -x; } const int MAXN = 60; int n, m, d; char map[MAXN][MAXN]; int posx, posy; int pts[20000][2]; int main() { int ...
0
C10132
C10284
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <string> #include <utility> #include <vector> #include <cstdlib> using namespace std; bool within_range(long long int x_, long long int y_, long long int x, long long int y, long long int d) { return (x-x_)*(x-x_)+(y-y_)*(y-y_) <= d*d; } int sgn(int n) { if (n < 0) { r...
0
C10132
C10252
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#define _CRT_SECURE_NO_DEPRECATE #include<iostream> #include<string> #include<sstream> #include<vector> #include<deque> #include<queue> #include<stack> #include<numeric> #include<math.h> #include<set> #include<map> #include<fstream> #define epsilon 0.000000001 #define cosinusa(a, b, c) ((a * a + b * b - c * c) / (2.0 *...
0
C10132
C10029
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include "StdAfx.h" #include "GoogleCase.h" GoogleCase::GoogleCase()//)QObject* parent /*= 0*/) // : QObject(parent) { } GoogleCase::~GoogleCase() { }
0
C10132
C10262
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
// mirror.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <fstream> #include <iostream> #include <string> #include <stdio.h> #include <math.h> #include <vector> #include <deque> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { std::ifstream cin(argv[1]); std::...
0
C10132
C10325
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <list> #include <stack> #include <queue> #include <set> #include <map> #include <algorithm> #include <iomanip> #include <iostream> #include <sstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <cfloat> #include <climits> #include <numeric> #include <ctime> using namespac...
0
C10132
C10023
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#pragma once #define ArraySize_(a) (sizeof(a)/sizeof(a[0])) #define recast_ reinterpret_cast #define stcast_ static_cast
0
C10132
C10331
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cmath> #include <iostream> #include <vector> using namespace std; struct pt { long x; long y; pt(){} pt(long x_,long y_):x(x_),y(y_){} long abs2(){return x*x+y*y;} pt operator+(const pt &p){return pt(x+p.x,y+p.y);} pt operator-(const pt &p){return pt(x-p.x,y-p.y);} bool operator==(const pt &p){re...
0
C10132
C10249
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <string> using namespace std; #include <assert.h> const unsigned maxT = 100; const unsigned maxHW = 100; const unsigned maxD = 50; unsigned H, W, D; unsigned myH, myW; char map[maxHW][maxHW]; unsigned gcd(int m, int n) { assert(m > 0 && n > 0); if (m > n) { int t = m; ...
0
C10132
C10245
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
/* * main.cpp * * Created on: 2011/09/24 * Author: taik */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <float.h> #include <vector> #include <set> #include <list> #include <algorithm> typedef long long s64; #define debug_printf printf //#define debug_printf struc...
0
C10132
C10040
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <sstream> #include <cstdio> #include <cmath> #include <cstring> #include <cctype> #include <string> #include <vector> #include <list> #include <set> #include <map> #include <queue> #include <stack> #include <algorithm> using namespace std; #define DEBUG(x) cout << '>' << #x << ':' << x...
0
C10132
C10082
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include...
0
C10132
C10212
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <algorithm> #include <iostream> #include <vector> #include <map> #include <set> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef unsigned long ul; typedef unsigned short us; typedef unsigned char uc; int gcd(int x,int y){int t;if(!x)return y;for(y%=x;y;t=y,y=x%y,x=t);return...
0
C10132
C10058
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <map> using namespace std; int h, w, d; char in[50][50]; int s[4][2], x, y; map<int, map<int, int> > mark; int gcd(int x, int y) { int c; if(x == 0) return y; if(y == 0) return x; while(c = x % y) { x = y; y = c; } return y; } int abs(int x) { if(x < 0) x = -x; return x; ...
0
C10132
C10282
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<algorithm> using namespace std; const double eps = 1e-7; int n, m, k, sx, sy; char s[35][35]; bool u[105][105]; int gcd(int a, int b) { if(b==0) return a; else return gcd(b, a%b); } double get(double x, double d) { if(d > eps) { double res = (int)...
0
C10132
C10024
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#pragma once // -- system includes #include <new> // -- libs includes #include "core/cmemory.h" #include "core/types.h" #include "core/utils.h" #include "core/assert.h" #include "containers/cdataptr.h" // ================================================================================================ // Default comp...
0
C10132
C10278
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <list> #include <map> #include <set> #include <stack> #include <queue> #include <algorithm> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <cstring> #include <climits> #include <cfloat> #include <numeric> using namespace std; const int oo = 0x3f3f3f3f; c...
0
C10132
C10175
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstring> #include <c...
0
C10132
C10083
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <set> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define mp make_pair const double eps=1e-9; struct jilu { int x,y; }que[200000]; int n,m,d,res,stx,sty; int dir[4][2]={{0,1},{0,-1},{1,0},{-1,0}}; set < pair<int,int> > hash,hash2; ch...
0
C10132
C10148
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <utility> #include <cmath> #include <vector> #include <queue> #include <cstring> #include <cstdlib> #include <cstdio> #include <algorithm> #include <map> using namespace std; typedef long long int uint64; #define MAXN 35 #define MAXC 410 #define MID (MAXC / 2) int H, W, D; int X, Y; char...
0
C10132
C10155
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<fstream> #include<vector> #include<string> using namespace std; int main(){ ifstream in("s4.in"); ofstream out("s4.out"); int T; in>>T; for (int t=0;t<T;t++){ int W,H,D; in>>H>>W>>D; int sx,sy; char c; string s; for (int i=0;i...
0
C10132
C10055
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<algorithm> #include<utility> #include<vector> using namespace std; int T; char s[40][40]; vector<pair<int,int> > V; int divide(int x,int y) { if(y==0) return 0; return x/y; } bool divisible(int x,int y) { return x*y>=0; } int abs(int x) { if(x>=0) retu...
0
C10132
C10265
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <set> using namespace std; #define N 35 char m[N][N]; int ab(int x) { return x<0?-x:x; } int gcd(int x, int y) { return !y?x:gcd(y, x%y); } set <int> s; void ins(int x, int y) { int g=gcd(ab(x), ab(y)); if(g) s.insert((x/g+10000)*10000+y/g+10000); } int main() { int r, c, i, j, k, l, t, t...
0
C10132
C10186
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdint.h> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <limits> #include <cstdio> #include ...
0
C10132
C10256
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<cstdio> #include<string> #include<set> #include<cmath> #define EPS 0.00000001 using namespace std; typedef long long ll; int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b); } int h,w; double d; char st[35][35]; bool eq(double a, double b){ return (a<b+EPS && b<a+EPS); } int main...
0
C10132
C10069
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<string> #include<fstream> using namespace std; #define maxn 200 char let[26]={'y','h','e','s','o','c','v','x','d','u','i','g','l','b','k','r','z','t','n','w','j','p','f','m','a','q'}; int main() { ifstream in("A-small-attempt5.in"); ofstream out("A-small-attempt5.out"); string que,ans,tmp...
0
C10132
C10021
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
/* This is a version (aka dlmalloc) of malloc/free/realloc written by Doug Lea and released to the public domain, as explained at http://creativecommons.org/licenses/publicdomain. Send questions, comments, complaints, performance data, etc to dl@cs.oswego.edu * Version 2.8.4 Wed May 27 09:56:23 2009 Doug Lea...
0
C10132
C10176
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <math.h> int i, j, k, cnt; int n, H, W, D, nw; char a[30][31]; enum TYPE { reflect, blackhole, nothing, back }; struct P { double x, y; double len() { return sqrt(x*x + y*y); } void normalize() { static double d; d = len(); x /= d; y /= d; } } start, v; P was[1000000]; ...
0
C10132
C10285
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<algorithm> using namespace std; #define N 250 #define M 35 int ttest, test, i, j, k, h, w, d, res, t1, t2; int x, y, W, H, start, a, q; double temp; int map[N][N] = {0,}, dxdy[N][N] = {0,}; char s[M][M] = {0,}; void srs(); int main() { //FILE *fp1 = f...
0
C10132
C10291
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <cstdio> #include <algorithm> #include <numeric> #include <climits> #include <sstream> #include <cstring> #include <cassert> #include <vector> #include <stack> #include <queue> #include <cmath> #include <map> #include <set> #define INF (INT_MAX/3) typedef long long lint; using namespace ...
0
C10132
C10227
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <cmath> using namespace std; ofstream ps("graphics.ps"); char tbl[30][30]; typedef long long ll; ll h,w,D; double scale=10; double offsetx=0; double offsety=0; bool is_mirror(int i,int j){ if (i<0 || i>=h || j<0 || j>=w) return fa...
0
C10132
C10065
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<sstream> #include<vector> #include<map> #include<string> #include<string.h> #include<algorithm> #include<math.h> #include<stdio.h> #include<stdlib.h> #include<queue> #include<stack> #define INF (1<<29) #define EPS (1e-12) #define two(a) (1<<(a)) #define rep(a,b) for(a=0 ; a<b ; ++a) #define ...
0
C10132
C10220
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<cstdio> #include<algorithm> #include<cmath> #include<vector> #include<numeric> #include<map> #include<set> #include<cstdlib> #include<string> #include<cassert> #include<iostream> using namespace std; typedef vector<int> vi; typedef long long int64; #define FOR(i,n)for(int i=0;i<(int)(n);i++) #define MAX 200000...
0
C10132
C10036
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <map> #include <set> #include <cmath> #include <stack> #include <queue> #include <string> #include <vector> #include <bitset> #include <fstream> #include <sstream> #include <stdio.h> #include <ctype.h> #include <string.h> #include <iostream> #include <algorithm> #include <sys/time.h> using namespace std; #defi...
0
C10132
C10213
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cmath> #include <cstring> #include <iostream> #define MAX 30 int h, w; char grid[MAX][MAX+1]; using namespace std; int gcd(int i, int j) { i = abs(i); j = abs(j); int temp; while (i) temp = i, i = j - (j / i * i), j = temp; return j; } void dostep(int& i, int& j, int&...
0
C10132
C10080
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <cmath> #include <string> #include <deque> #include <algorithm> using namespace std; int n,m,d; char map[40][40]; #define MAX 300 short field[MAX][MAX]; deque<int> X; deque<int> Y; bool used[MAX][MAX]; int dx[]={-1,1,0,0}; int dy[]={0,0,-1,1}; int Abs(int x){ return (x>=0)?x:-x; ...
0
C10132
C10167
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<set> #include<cmath> #include<vector> #define REP(i,m) for(int i=0;i<m;++i) #define REPN(i,m,in) for(int i=in;i<m;++i) #define pb push_back #define mp make_pair #define fr first #define ALL(t) (t).begin(),(t).end() #define sc second #def...
0
C10132
C10333
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <fstream> #include <cmath> using namespace std; int check(int f[30][30],int x0,int y0,int x1,int y1){ double x(x0+0.5),y(y0+0.5),l(0); double dx=x1/1000.0; double dy=y1/1000.0; for(int i=0;i<1000;i++){ //cout<<x<<' '<<y<<' '<<l<<endl; x+=dx;y+=dy; l+=sqrt(d...
0
C10132
C10163
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#define Federico using #define Javier namespace #define Pousa std; #include <iostream> #include <fstream> #include <string> #include <set> #include <vector> #include <map> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cmath> #include <stack> #include <queue> #include <cstring> #include <sstream> ...
0
C10132
C10214
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <string> #include <vector> #include <queue> #include <map> #include <set> #include <algorithm> #include <sstream> #include <iostream> #include <cassert> using namespace std; typedef long long ll; #define REP(i,n) for (int i=0; i<(int)(n)...
0
C10132
C10118
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <algorithm> using namespace std; char map[70][70]; int H, W, D; int wx, wy; void input() { scanf("%d %d %d\n", &H, &W, &D); for(int y=0; y<H; y++) { for(int x=0; x<W; x++) { scanf("%c", &map[2*x][2*y]); map[2*x+1][2*y] = map[2*x+1][2*y + 1] = map[2*x][2*y +1] = map[2*x][2*y]; ...
0
C10132
C10165
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <utility> using std::make_pair; using std::pair; int T, H, W, D; char m[30][31]; pair<int, int> find_X() { for(int i=0; i<H; ++i) { for(int j=0; j<W; ++j) { if(m[i][j]=='X') { return make_pair(i, j); } } } ...
0
C10132
C10182
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include "Rational.h" #include <iostream> using namespace std; int gcd(int a, int b) { if (a < 0) a = -a; if (b < 0) b = -b; while (a!=0 && b!=0) { if (b > 0 && a >= b) a %= b; if (a > 0 && b >= a) b %= a; } if (a) return a; else return b; } //====== class Rational // int p, q; int compare(const R...
0
C10132
C10207
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <iostream> #include <string> #include <map> #include <cstring> #include <cassert> using namespace std; char maze[111][111]; int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a); } long long dist2(long long x, long long y) { return x * x + y * y; } int cond = 0; #define db(...
0
C10132
C10089
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <algorithm> #include <iostream> #include <sstream> #include <cstring> #include <cstdio> #include <cmath> #include <complex> #include <numeric> #include <vector> #include <string> #include <queue> #include <map> #include <set> using namespace std; #define all(a) (a).begin(), (a).end() #define sz(a) int((a).si...
0
C10132
C10018
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
// -- system includes #include <windows.h> #include <time.h> // -- libs includes #include "core/ctimer.h" enum { ePerfCounter, eClock, }; // ================================================================================================ // Constructor // =====================================================...
0
C10132
C10242
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
using namespace std; #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <list> #include <set> #include <algorithm> #include <utility> #include <functional> #include <numeric> #include <math.h> #include <string.h> #include <ctype.h> #inclu...
0
C10132
C10136
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <string> #include <vector> #include <fstream> #include <set> #include <utility> std::pair<int, int> reduction(std::pair<int, int> const& v) { int a = v.first; int b = v.second; if(a == 0 && b == 0) return std::make_pair(0, 0); else if(a == 0) return std::make_pair(0, (...
0
C10132
C10166
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#undef NDEBUG #include <assert.h> #include <set> #include <stdio.h> #include <stdint.h> #include <string.h> #include <gmpxx.h> namespace { typedef mpz_class Z; typedef mpq_class Frac; struct Pt { Frac i, j; Pt &operator -= (const Pt &o) { i -= o.i; j -= o.j; return *this; } Pt operator - (const Pt &o) const { r...
0
C10132
C10149
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <queue> #include <deque> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace st...
0
C10132
C10202
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <iostream> #include <set> #include <math.h> using namespace std; int mmap[40][40]; int dcmp(double a){ if(a>1e-8)return 1; if(a<-1e-8)return -1; return 0; } int main() { int t,H,W,D,j,k,mph,mpw,i,cnt; double x,y,a,ta; char c; FILE* in; FILE* out; char temp[50]; in=fopen("D-s...
0
C10132
C10218
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <vector> using namespace std; bool collinear(int dx, int dy, const vector<int>& X, const vector<int>& Y) { for (size_t i = 0; i != X.size(); ++i) { if (dx*Y[i] == dy*X[i]) { // collinear ... just check in same direction from origin. pick // a non-zero axis and compare s...
0
C10132
C10115
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<fstream> #include<vector> #include<set> #include<math.h> std::ifstream file; std::ofstream ofile; #define MAXD 52 char maze[33][33]; int h,w; int d; int ex; int ey; int top,botton,left,right; class CPos{ public: CPos(int a,int b) : x(a),y(b) {}; void print(){ std::cout << x << ":" <<...
0
C10132
C10007
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#pragma once // -- libs includes #include "core/types.h" #include "containers/ctable.h" // -- forward declarations class CPrimeCalculator; // ================================================================================================ // Class with functionality for finding prime factors / divisors of integers /...
0
C10132
C10139
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <string> #include <vector> #include <cstdlib> #include <algorithm> #include <cmath> #include <cstring> #include <cstdio> using namespace std; #define maxn 100 int n,m,Len,x,y,TT,aa[maxn],bb[maxn],Ans; char Dat[100]; int Gcdit(int x,int y) { if (x < y) return Gcdit(y,x); if (y == 0) retu...
0
C10132
C10154
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <set> #include <algorithm> using namespace std; char str[100]; inline int gcd(int a,int b){ if(a<0) a=-a; if(b<0) b=-b; if(!b) return a; while((a%=b) && (b%=a)); return a+b; } int main(){ int TT,tt,n,m,i,j,s,W,H,r,x,y,tx,ty,d; set<pair<int,int> > ss; scanf...
0
C10132
C10200
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <string> #include <sstream> #include <cmath> #include <set> #include <utility> using namespace std; inline int absInt(int a) { return a > 0 ? a : -a ; } // base p paire // dx, dy entiers / p // le reste en unites habituelles bool reflet(int p, int xPos, int yPos, int dx, int dy, int ...
0
C10132
C10254
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<cstdio> #include<set> using namespace std; int H, W, D; char F[32][32]; int X, Y; set<pair<int, int> >se; int gcd(int a, int b){return b?gcd(b, a%b):a;} int tate(int x, int y, int dx, int dy){ int lx, ly; lx=x/2*2*(W-2); if(x%2){ if(dx==1)lx+=(W-X-2)*2+1; else lx+=(X-1)*2+1; } ly=y/2*2*...
0
C10132
C10063
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <set> #include <utility> using namespace std; int H, W, D, D2; int my_r, my_c; char map[31][31]; set<pair<int, int> > sol; int dist2(int r1, int c1, int r2, int c2) { int dr = abs(r1 - r2); int dc = abs...
0
C10132
C10235
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
// // Qualification round 2012 problem B // // Usually built with g++ 4.4.5 on Linux // #include <iostream> #include <iomanip> #include <vector> #include <set> #include <gmpxx.h> #include <cstdlib> #include <math.h> using namespace std; struct Point { unsigned int x; unsigned int y; Point( unsigned i...
0
C10132
C10223
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
//#include "LongInt.h" #include <QtCore/QCoreApplication> #include <iostream> #include <cstdlib> #include <iomanip> #include <algorithm> #include <fstream> #include <string> #include <list> #include <vector> #include <cassert> #include <cmath> #include <QPoint> using namespace std; ifstream fin; ofstream fout; void p...
0
C10132
C10250
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
//============================================================================ // Name : codejam_2012_q.cpp // Author : festony // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //==========================================================================...
0
C10132
C10108
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include "bind.h" #include <math.h> #define precise 1e-8 char grid[100][100]; int hashtable[200][200]; double o_px, o_py; int o_x, o_y; int h, w, number; double d; bool eq(double x, double y) { if (abs(x - y) < precise) return true; return false; } double len(double x, double y) { return sqrt(x * x + y * y); } c...
0
C10132
C10306
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <string> #include <set> #include <vector> using namespace std; int gcd(int a, int b) { while (b != 0) { int t = b; b = a % b; a = t; } return a; } int main() { int num_tests; cin >> num_tests; for (int test = 1; test <= num_tests; ++test) { int h, w, d; cin >> h >> w >> d;...
0
C10132
C10070
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstring> #include <fstream> #include <sstream> #include <string> #include <vector> using std::ifstream; using std::ofstream; using std::string; using std::stringstream; using std::vector; using std::pair; class CodeJamIO { private: string append(const char* a, const char* b) { string c(a); c += ...
0
C10132
C10014
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#pragma once // -- libs includes #include "core/types.h" // ================================================================================================ // Class for all logging we need to do // ================================================================================================ class CLog { public: ...
0
C10132
C10190
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cassert> #include <vector> #include <algorithm> #include <map> #include <set> using namespace std; int n, m, D; int nt; template<typename T> class Point { public: T x, y; Point() : x(0), y(0) {} Point(const T &x, const T &y) : x(x), y(y) {} Point(const Point<T> &p) : x(p.x), y(p.y) {}...
0
C10132
C10324
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
//**** HEADER **** #include <algorithm> #include <cmath> #include <climits> #include <iostream> #include <sstream> #include <cstdio> #include <string> #include <cstring> #include <vector> #include <set> #include <map> #include <queue> using namespace std; typedef long long int64; //typedef __int128_t int128; typedef ...
0
C10132
C10198
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#pragma comment(linker, "/STACK:32000000") #define _CRT_SECURE_NO_DEPRECATE #include <algorithm> #include <set> #include <vector> #include <map> #include <queue> #include <stack> #include <string> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <stdarg.h> #include <memory.h> #include...
0
C10132
C10230
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include<iostream> #include<fstream> #include<sstream> #include<cstdio> #include<algorithm> #include<vector> #include<set> #include<cmath> #include<cstring> using namespace std; #define FOR(I,A,B) for (int I=int(A);I<int(B);++I) #define MEM(A,B) memset(A,B,sizeof(A)); #define CPY(A,B) memcpy(A,B,sizeof(B)); typedef __...
0
C10132
C10047
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include "algo.h" #include <QString> #include <QDebug> #include <math.h> #define max(a,b) ((a)<(b)?(b):(a)) #define min(a,b) ((a)>(b)?(b):(a)) #define sign(a) ((a)>0?1:((a)<0?-1:0)) #define theOther(a) ((a)==ORANGE?BLUE:ORANGE) QMutex Algo::mutex; int hcf(int a, int b) { int t=0; if(a == 0) { retur...
0
C10132
C10003
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
// -- libs includes #include "core/cmemory.h" #include "core/utils.h" #include "numerics/csieve.h" // ================================================================================================ // Destructor // ================================================================================================ CSieve...
0
C10132
C10117
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cmath> #include <set> using namespace std; struct p { int x, y; bool operator <(const p& other) const { return atan2(y,x) + 0.000001 < atan2(other.y, other.x); } }; int main(int argc, char *argv[]) { int T; scanf("%d", &T); for (int t=0; t<T; ++t) { int H, W, D, x, y; ...
0
C10132
C10310
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <fstream> #include <iostream> #include <utility> #include <vector> using namespace std; int sgn(int n) { if (n == 0) return 0; else if (n > 0) return 1; else return -1; } bool Colinear(const pair<int, int> &p1, const pair<int, int> &p2) { if (sgn(p1.first) != sgn(p2.fi...
0
C10132
C10109
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <iostream> #include <vector> using namespace std; int gcd(int m, int n) { m = abs(m); n = abs(n); if (m < n) swap(m, n); if (n == 0) return m; return gcd(n, m % n); } int solve(int H, int W, int D, vector<string>& hall) { int posX, posY; for (int r = 0; r < H; r++) { for (int c = 0; c < W; ...
0
C10132
C10225
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cmath> #include <set> #include <iostream> using namespace std; char cell[30][31]; template <class T> inline T gcd(T a, T b) { if(a < 0) return gcd(-a, b); if(b < 0) return gcd(a, -b); return (b==0)?a:gcd(b, a%b); } set < pair<int, int> > res; int main() { freopen("D-smal...
0
C10132
C10170
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cstring> using namespace std; bool oo[55][55][2],same[55][55][4]; int list[220]; int n,m,d,dx,dy,sx,sy,ans,top,times; char data[33][33]; int cj(int x1,int y1,int x2,int y2) { return x1*y2-x2*y1; } bool xj(int x1,int y1,int x2,int y2,int x3,int y3,int x4,int y4) { if (cj(x3-x...
0
C10132
C10276
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <cfloat> #include <ctime> #include <cassert> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include...
0
C10132
C10319
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <algorithm> #include <iostream> #include <cassert> #include <cstring> #include <cstdio> #include <vector> #include <cmath> #include <map> #include <set> #define SIZE(A) ((int)A.size()) #define LENGTH(A) ((int)A.length()) #define MP(A,B) make_pair(A,B) #define PB(A) push_back(A) typedef long long ll; typedef ...
0
C10132
C10199
#include <cstdio> #include <vector> #include <string> #include <sstream> #include <set> #include <algorithm> #include <iostream> using namespace std; typedef long long LL; char a[1 << 5][1 << 5]; const int dx[4] = {-1, -1, 1, 1}; const int dy[4] = {-1, 1, 1, -1}; int h, w, d, t; int sx, sy; set<pair<int, int> > S;...
#include <stdio.h> #include <algorithm> #include <cmath> using namespace std; int gcd(int a, int b) { if(a < 0) a = -a; if(b < 0) b = -b; while(a) { b %= a; swap(a, b); } return b; } int h,w,d; char dat[32][32]; int sx, sy; const double eps = 1e-9; double getdist(double x, double y, int dx, int dy, dou...
0