Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
int Max(int a, int b) { return a > b ? a : b; }
int main() {
int i, j, n, max = 0, d[501][501] = {0};
scanf("%d", &n);
for (i = 1; i <= n; i++)
for (j = 1; j <= i; j++) {
scanf("%d", &d[i][j]);
if (j == 1)
#include <iostream>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int input;
cin >> input;
#include <iostream>
using namespace std;
const int MAX = 1000;
int N;
int d[4][MAX + 1];
int house[4][MAX + 1]; // [1] : red, [2] : green, [3] : blue
int main(void)
{
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
const int INF = 987654321;
const int MAX = 50;
int M, N;
string board[MAX];
//(0, 0)이 W인 체스보드
#include <iostream>
using namespace std;
const int MAX = 1000000;
bool check[MAX+1];
int main() {
check[0] = check[1] = true;
for (int i=2; i*i<=MAX; i++) {
if (check[i] == false) {
for (int j=i+i; j<=MAX; j+=i) {
#include <iostream>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int num1, num2, minNum, repeat = 1;
cin >> num1;
#include <iostream>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int testCnt;
cin >> testCnt;
#include <iostream>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int test;
cin >> test;
#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int manCnt;
#include<iostream>
#include<cstdio>
using namespace std;
int warp(int dist) {
long long n, minN, powN, maxN, warpCount= 0;
for(n=1;;n++){
powN = n*n;
minN = powN - n + 1;
maxN = powN + 1 + n - 1;