prompt string | response string |
|---|---|
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int i,count,n;
while(true){
count=0;
n=sc.nextInt();
if(n==0) break;
for(i=0;i<n/4;i++){
count+=sc.nextInt();
}
System.out.println(count);
}
}
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n;
while(cin>>n,n){
ll ans = 0;
for(int i=0;i<n/4;i++){
ll a;
cin >> a;
ans += a;
}
cout << ans << endl;
}
}
|
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | while True:
game_count = int(input()) // 4
if game_count == 0:
break
hit_count = 0
for _ in range(game_count):
hits = int(input())
hit_count += hits
print(hit_count)
|
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int n,cnt,ans;
while(1){
cin >> n;
if(n == 0){
break;
}
ans=0;
for(int i=0;i<n/4;i++){
cin >> cnt;
ans += cnt;
}
cout << ans << endl;
}
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin>>n,n){
int sum=0;
int temp;
for(int i=0;i<n/4;++i){
cin>>temp;
sum+=temp;
}
cout<<sum<<endl;
}
}
|
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include<stdio.h>
int main(){int n,k,s;for(;scanf("%d",&n),s=0,n;){for(;n>0;n-=4)scanf("%d",&k),s+=k;printf("%d\n",s);}} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main() {
int a;
while (cin >> a, a) {
int s = 0;
for (int b = 0; b < a / 4; b++) {
int c;
cin >> c;
s += c;
}
cout << s << endl;
}
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
using namespace std;
int main(){
int N;
while(cin>>N,N){
int sum=0;
for(int i=0;i<N/4;i++){
int t;
cin>>t;
sum+=t;
}
cout<<sum<<endl;
}
}
|
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
#include<vector>
#include <algorithm>
using namespace std;
int main()
{
int n,b,sum;
vector<int> a;
while(cin>>n,n){
sum = 0;
a = {0};
for(int i = 0;i < n/4;++i){
cin>>b;
a.push_back(b);
}
for(int e : a){
sum += e;
}
cout<<sum<<endl;
}
... |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include<iostream>
#include<cstring>
using namespace std;
int main()
{
int n,p;
for(;cin>>n,n;)
{
int sum=0;
for(int i=0;i<n/4;i++)
{
int tmp;
cin>>tmp;
sum+=tmp;
}
cout<<sum<<endl;
}
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <bits/stdc++.h>
int main(void) {
using namespace std;
while (true) {
int n;
cin >> n;
if (n == 0) {
break;
}
int sum = 0;
int score;
for (int i = 0 ; i < n / 4 ; i++) {
cin >> score;
sum += score;
}
... |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
using namespace std;
int main(int argc, char **argv)
{
int n, sum, tmp;
while(1){
cin >> n;
if(n == 0){
break;
}
n /= 4;
sum = 0;
for(int i = 0; i < n; i++){
cin >> tmp;
sum += tmp;
}
cout << sum << endl;
}
return 0;
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
using namespace std;
void solve()
{
int n;
while(cin >> n, n)
{
int sum = 0;
for(int i = 0; i < n / 4; ++i)
{
int temp;
cin >> temp;
sum += temp;
}
cout << sum << endl;
}
}
int main()
{
solve();
return(0);
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
int main(){
int n;
while(cin>>n,n){
int ans=0,num;
rep(i,n/4){
cin>>num;
ans+=num;
}
cout<<ans<<endl;
}
return 0;
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
using namespace std;
int main(){
int n,i,a,point;
while(cin >> n && n){
point = 0;
for(i = 0;i < n / 4;i++){
cin >> a;
point += a;
}
cout << point << endl;
}
return 0;
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include<iostream>
#include<vector>
int main(){
int a,b,c;
c=0;
b=1;
std::vector<int> e(1);
while(true){
std::cin>>a;
if(a==0){
break;
}
a=a/4;
std::vector<int> v(a);
for(int i=0;i<a;++i){
std::cin>>v[i];
}
for(int i=0;i<a;++i){
c=c+v[i];
}
e[b-1]=c;
c=0;
b=b+1;
e.resize(b);
}
... |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
using namespace std;
int main(){
int n;
int result;
int tmp;
while(cin >> n, n!=0){
result = 0;
n /= 4;
for(int i=1; i<=n; i++){
cin >> tmp;
result += tmp;
}
cout << result << endl;
}
return 0;
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
while(cin>>n){
if(n==0) break;
vector<int> v;
for(int i=0,in;i<n/4;++i){
cin>>in;
v.push_back(in);
}
int sum=0;
for(vector<int>::iterator it=v.begin();it<v.end();++it){
sum+=*it;
}
cout<<sum<<"\n";
}
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int N = sc.nextInt();
if(N==0)break;
int t=0;
for(int i=0;i<(N/4);i++){
t += sc.nextInt();
}
System.out.println(t);
}
}
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
while (cin >> N, N) {
int sum = 0;
for (int i = 0, x; i < N/4; i++) cin >> x, sum += x;
cout << sum << endl;
}
return 0;
} |
Problem: Ito joined the Kyudo club after entering high school. At first, I had a hard time because the arrow didn't reach the target, but in the fall of my first year of high school, I managed to improve to the point where the arrow reached the target.
One day, my senior Kato suggested, "Why don't you participate in a... | #include<iostream>
using namespace std;
int main(){
int n, x;
while( cin >> n ){
if ( n == 0 ) break;
int sum = 0;
for ( int i = 0; i < n/4; i++ ){
cin >> x;
sum += x;
}
cout << sum << endl;
}
} |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <vector>
#include <complex>
#include <iomanip>
using namespace std;
typedef complex<double> P;
const double EPS = 1e-10;
int n;
double l[10];
struct C {
P p;
double r;
C() {
p = P(0, 0);
r = 0;
}
C(const P& p, double r) : p(p), r(r) {
}
bool in(P t) {
return norm(p - t) < r... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<cstdio>
#include<vector>
#include<algorithm>
#include<iostream>
#include<complex>
using namespace std;
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)
const int INF = 1000000000;
#define X real()
#define Y imag()
typedef complex<double> Point;
class Line{
public:
double A,B,C... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;
typedef complex<double> Complex;
const double EPS = 1e-10, PI = M_PI;
ll N;
Complex P[10];
double L[10];
bool check(Complex p, vector<double> r) {
bool ret = true;
REP(i, 0, N) ret = re... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) ((int)(a).size())
#define F first
#define S second
typedef pair<int,int> PI;
int n;
int x[100],y[100],l[100];
pair<dou... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <algorithm>
#include <complex>
#include <iostream>
#include <vector>
using namespace std;
static const double eps = 1e-10;
typedef complex<double> point;
struct circle { point p; double r; };
inline double sq(double x) { return x * x; }
pair<point, point> cross(const circle& c1, const circle& c2)
{
doubl... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <it... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
struct Point{
double x, y;
Point(double x = 0, double y = 0): x(x), y(y) {}
Point operator + (Point p) { return Point(x + p.x, y + p.y); }
Point operator - (Point p) { return Point(... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)
typedef double D;
typedef complex<D> P;
typedef vector<P> VP;
const D EPS = 1e-7;
#define X real()
#define Y imag()
#define EQ(n,m) (abs((n)-(m)) < EPS)
VP crosspointCC(P a, D ar, P b, D br) {
VP ps;
P ab = b-a;
D d = abs... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<iostream>
#include<algorithm>
#include<iomanip>
#include<queue>
#include<vector>
#include<complex>
using namespace std;
#define int long long
// 2円の交点
typedef double D; // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P; // Point
typedef pair<P, P> L; // Line
typedef vector<P> VP;
const D EPS = 1e-9; ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
#define ISLOOSE(a,b) (disdis(a, b) + get<2>(a) * get<2>(a) <= get<2>(b) * get<2>(b))
using namespace std;
double disdis(const tuple<double, double, double>& a, const tuple<int, int, int>& b)
{
return (get<0>(a) - get<0>(b)) * (get<0>(a) - get<0>(b)) + (get<1>(a) - get<1>(b)) * (get<1>(... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
#include <map>
#define FOR(i,a,b) for(int i=(int)a; i<(int)b; ++i)
#define REP(i, n) FOR(i,0,n)
template<class T> void CHMAX(T & a, T b) { a = (a >= b ? a : b); }
constexpr int INFINT = (1 << 30) - 1;
constexpr double EPS = ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main{
public static Rope[] rope;
public static int n;
public static double EPS = 1e-8;
public static void main(String[] args){
Scanner in = new Scanner(System.in);
while(true){
n = in.nextInt();
if(n == 0) return;... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cstdlib>
#include <cmath>
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#include <queue>
#include <set>
#include <cstdio>
#include <complex>
inline int getInt(){ int s; scanf("%d", &s); return s; }
using namespace std;
const double EPS = 1e-9;
typedef complex<double> P;
struct C {
P p; double r;
C(... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <random>
... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
#define ISLOOSE(a,b) (disdis(a, b) + get<2>(a) * get<2>(a) <= get<2>(b) * get<2>(b))
using namespace std;
double disdis(const tuple<double, double, double>& a, const tuple<double, double, double>& b)
{
return (get<0>(a) - get<0>(b)) * (get<0>(a) - get<0>(b)) + (get<1>(a) - get<1>(b)) * (... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b)) < EPS)
using namespace std;
const int IINF = INT_MAX;
// Library
class Point{
public:
double x,y;
Point(double x = -IINF,double y = -IINF): x(x),y(y){}
Point oper... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
double EPS = 1e-9;
typedef complex<double> P,point;
struct C {P p; double r;C(const P &p, double r) : p(p), r(r) { } C(){} };
vector<P> C_cp(C a,C b){
vector<P> ret;
double L = abs(a.p-b.p);
/* anma dekitenai */
if( L-a.r-b.r > EPS || (abs(a.p-b.p)<EPS && fabs(a.r-... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <vector>
#include <algorithm>
#include <complex>
using namespace std;
static const double eps = 1e-10;
typedef complex<double> point;
struct circle { point p; double r; };
inline double sq(double x) { return x * x; }
pair<point, point> cross(const circle& c1, const circle& c2)
{
doubl... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<iomanip>
const double EPS=1e-10;
bool eq(double a,double b){return abs(a-b)<EPS;}
struct Point{
double x,y;
Point(double x_=0,double y_=0):x(x_),y(y_){}
Point ope... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cmath>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
struct vec{
double x,y;
vec(){x=y=0.0;};
vec(double x, double y): x(x), y(y){};
inline double add(double a, double b){
return abs(a+b)<(1e-10)*(abs(a)+abs(b))?0.0:a+b;
}
vec operator-(vec b){... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <complex>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define EQ(a,b) (abs((a)-(b))<eps)
using namespace std;
typedef long double ld;
typedef complex<ld> P;
typedef vector<P> VP;
const ld eps = 1e... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <sstream>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
#define EPS 1e-9
struct point{
double x, y;
point(){x = 0... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <vector>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef complex<double> P;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(c) (c).begin(), (c).end()
const double eps = 1e-8, inf = 1e8;
template<typename T> T sqr(T x){return x*x;}
double cross(... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<set>
#include<list>
#include<queue>
#define _USE_MATH_DEFINES
#include<cmath>
#include<functional>
#include<algorithm>
using namespace std;
#define INF 1e+10
#define EPS 1e-10
#define EQ(a,b) (abs(a-b)<EPS)
//誤差を考慮して足し算
... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <sstream>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
#define EPS 1e-9
struct point{
double x, y;
point(){x = 0... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cmath>
#include <vector>
#include <utility>
#include <cstdio>
using namespace std;
#define sqr(x) ((x) * (x))
struct sphere {
double x, y, r;
sphere(double x_, double y_, double r_) {
x = x_; y = y_; r = r_;
}
};
const double EPS = 1e-10;
int main() {
int n;
while(cin >> n, n) {... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <set>
#include <map>
#include <complex>
#include <cmath>
using namespace std;
#define EPS 1.0e-8
#define PI 3.1415926535897932384
#define REP(i,n) for(int i = ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <vector>
#include <cmath>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
#define repeat_from(i,m,n) for (int i = (m); (i) < (n); ++(i))
using namespace std;
const double eps = 1e-7;
double sq(double x) { return x * x; }
struct point {
double x, y;
};
point operator + (point con... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl
template<class T> bool set_min... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
#define EPS 1e-6
struct node{
int x, y, len;
double r;
inline void cal_radius(double height){ r = sqrt(len * len - height * height); }
inline void read(){ scanf("%d%d%d", &x, &y, &len); }
} nodes[20];
int n;
inline bool intersect(co... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #ifndef _WIN32
#include<iostream>
#endif
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<tuple>
#include<complex>
#include<queue>
#include<functional>
using namespace std;
typedef long long LL;
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <functional>
#include <ca... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>
#include... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
#define EPS 1e-9
using namespace std;
typedef complex<double> P;
int N;
vector<double> X, Y, L;
bool check(int n, int m, int p, double h) {
P p1 = P(X[n], Y[n]);
P p2 = P(X[m], Y[m]);
P p3 = P(X[p], Y[p]);
double r1 = sqrt(L[n] * L[n] - h * h);
double r2 = sqrt(L[m] * L[m... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<iostream>
#include<cstdio>
#include<bits/stdc++.h>
#include<iomanip>
#include<queue>
#include<string>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<algorithm>
#include<functional> //for "greater<type>"
#include<cmath>
using namespace std;
#define pb push_back
#define fi first
#define ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS (1e-8)
#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
#define equals(a,b) (fabs((a)-(b)) < EPS)
using namespace std;
const int IINF = INT_MAX;... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <it... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
int n;
double x[10], y[10], l[10];
double search(double X, double Y){
double res = 1e+9;
for(int i = 0; i < n; i++){
double h = l[i] * l[i] - ((X - x[i]) * (X - x[i])) - ((Y - y[i]) * (Y - y[i]));
res = min(res, h);... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <sstream>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
#define EPS 1e-9
struct point{
double x, y;
point()... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
static int n;
static double[] x;
static double[] y;
static double[] l;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter pw=new PrintWriter(System.out);
while (true) {
n = sc.nextInt();
i... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const double EPS = 1e-8;
struct Point {
double x, y;
Point() : x(0), y(0) { }
Point(double x, double y) : x(x), y(y) { }
Point operator+(const Point &p) const { return Point(x + p.x, y + p.y); }
Po... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <vector>
#include <cstdio>
#include <cmath>
#include <complex>
#include <cfloat>
using namespace std;
typedef double D;
typedef complex<D> P;
typedef const P &rP;
typedef pair<P,P> seg;
typedef const seg &rseg;
#define EPS 1e-9
#define INF DBL_MAX
inline D cross(rP a, rP b){
return real(a) * imag(b) - imag... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
public class Main {
static PrintWriter out;
static InputReader ir;
static boolean debug = false;
static void solve() {
f... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <complex>
#include <iomanip>
#include <assert.h>
using namespace std;
typedef complex<double> P;
const double EPS = 1e-10;
int n;
double l[10];
struct C {
P p;
double r;
C() {
p = P(0, 0);
r = 0;
}
C(const P& p, double r) ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) f... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<cstdio>
#include<complex>
#include<utility>
#include<vector>
#include<cmath>
using namespace std;
double eps=1e-8;
typedef complex<double> Point;
typedef complex<double> Vector;
template<class T> bool eq(T a,T b){
return abs(a-b)<eps;
}
template<class T> int sgn(T r){
return eq(r,0.0)?0:(r>0?1:-1);
}
s... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
template<class T> inline void chmax(T& a, const T& b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }
constexpr double EPS = 1e-9;
constexpr int INF = 1000000;
struct point {
... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
template<class T> inline void chmax(T& a, const T& b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }
constexpr double EPS = 1e-9;
constexpr int INF = 1000000;
struct point {
... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
typedef complex<double> P;
const double EPS = 1e-8;
int sign(double x) {
if(x > EPS) return 1;
if(x < -EPS) return -1;
return 0;
}
struct C{
P p;
double r;
};
v... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
using ld = long double;
constexpr ld eps = 1e-9;
namespace geometry2d {
using point = std::complex<long double>;
using polygon = std::vector<point>;
bool eq(long double a, long double b) {
return (std::abs(a-b) < eps);
}
long double dot(point a, point b) {
... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "../dump.hpp"
#else
#define dump(...)
#endif
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
using vi = vector<int>;
using vvi = vector<vi>;
constexpr double inf = 1e10;
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return tru... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<iostream>
#include<complex>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;
const double eps=1e-9;
typedef complex<double> P;
vector<P> intersection(P a,double ra,P b,double rb){
double c=abs(b-a);
double costheta=-(rb*rb-ra*ra-c*c)/2/ra/c;
if(-1<=costheta&&costheta<=1){
... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)
typedef double D;
typedef complex<D> P;
typedef vector<P> VP;
const D EPS = 1e-7;
#define X real()
#define Y imag()
#define EQ(n,m) (abs((n)-(m)) < EPS)
VP crosspointCC(P a, D ar, P b, D br) {
VP ps;
P ab = b-a;
D d = a... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <complex>
#include <vector>
using namespace std;
typedef complex<double> P;
struct Circle{
double r;
P c;
Circle(double r=0.0, P c = P(0,0)):r(r),c(c){}
bool operator < (const Circle &c) const {
return r < c.r;
}
};
co... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<cstdio>
#include<vector>
#include<cmath>
#include<complex>
using namespace std;
const double EPS = 1e-10;
typedef complex<double> P;
bool zero(double a) { return abs(a) <= EPS; }
int n, x[10], y[10], l[10];
P dir[10];
double r[10];
bool canClear(P p, int i1, int i2) {
for (int i = 0; i < n; i++) if (i != ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <it... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)
template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void ch... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.util.StringTokenizer;
import ja... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
using T = long double;
const T INF = 1e10;
const T EPS = 1e-10;
const T PI = acos(-1.0);
T torad(int deg) {return (T)(deg) * PI / 180;}
T todeg(T ang... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#in... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cstdio>
#include <cmath>
#include <cfloat>
#include <cstring>
#include <cassert>
#include <vector>
#include <algorithm>
using namespace std;
/* double extention Library. */
const double EPS = 1e-8;
bool eq(double a, double b)
{
return (fabs(a - b) <= EPS);
}
bool lt(double a, double b)
{
retur... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <sstream>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
#define EPS 1e-9
struct point{
double x, y;
point()... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
double eps=1e-8;
struct S{
P s,t;
S(P s=P(),P t=P()): s(s),t(t) {}
};
struct C{
P p;
double r;
C(P p=P(),double r=0):p(p),r(r){}
};
bool eq(double a,double b){
return (-eps<a-b&&a-b<eps);
}
double Sqrt(double a){
if(a<0)return 0... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n); (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define rep(i, n) for(int (i)=0; (i)<(n); ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
#define DEBUG 1
#define INF (1.0/0.0)
#define EPS 1e-8
#define PI 3.1415926535
#define EQ(x, y) (abs((x)-(y))<EPS)
#define X real()
#define Y imag()
typedef complex<double> Point;
typedef Point Vec;
typedef array<Point, 2> Line;
typedef vector<Point> Poly;
struct Circle... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <complex>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
const double eps = 1e-8;
typedef complex<double> point;
typedef vector<point> polygon;
struct circle
{
point p;
double r;
circle(const point &p, double r) : p(p), r(r) {}
};
int n;
point p[10];
double... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdli... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <complex>
#include <vector>
using namespace std;
typedef complex<double> P;
struct Circle{
double r;
P c;
Circle(double r=0.0, P c = P(0,0)):r(r),c(c){}
bool operator < (const Circle &c) const {
return r < c.r;
}
};
co... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <algorithm>
#include <complex>
#include <vector>
#include <numeric>
#include <cmath>
#include <iterator>
using namespace std;
#define pb push_back
#define sz size()
#define fs first
#define sc second
#define rep(i, a) for(int i=0;i<(int)(a);i++)
#define EQ(a, b) (abs((a)-(b)) < EPS)
ty... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <it... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | //include
//------------------------------------------
#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 <... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <complex>
#include <iomanip>
#include <assert.h>
using namespace std;
typedef complex<double> P;
const double EPS = 1e-10;
int n;
double l[10];
struct C {
P p;
double r;
C() {
p = P(0, 0);
r = 0;
}
C(const P& p, double r) ... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
template<class T> inline void chmax(T& a, const T& b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }
const double EPS = 1e-9;
const int INF = 1000000;
struct point {
double x... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#in... |
Problem: Anchored Balloon
A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation.
<image>
Figure E-1: A balloon and ropes on the ground
Now the balloo... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
double eps = 0.0000001;
using p2 = complex<double>;
// x: real
// y: imag
double det(p2 v1, p2 v2) {
return v1.real() * v2.imag() - v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.