Submission #57822


Source Code Expand

#include <complex>
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;

typedef complex<double> Complex;

int main()
{
    int n;
    cin >> n;

    vector<Complex> v1(n), v2(n);
    for (int i = 0; i < n; i++) {
        double x, y; cin >> x >> y; v1[i] = Complex(x, y);
    }
    for (int i = 0; i < n; i++) {
        double x, y; cin >> x >> y; v2[i] = Complex(x, y);
    }

    Complex z0(v1[0]);
    for (int i = 0; i < n; i++) {
        v1[i] -= z0, v2[i] -= z0;
    }

    Complex w = (v2[1] - v2[0]) / v1[1];
    Complex z = v2[0] / (1.0 - w) + z0;

    cout << setprecision(12);
    cout << real(z) << " " << imag(z) << endl;

    return 0;
}

Submission Info

Submission Time
Task D - 地図が2枚
User yuizumi
Language C++ (G++ 4.6.4)
Score 100
Code Size 714 Byte
Status AC
Exec Time 23 ms
Memory 820 KB

Judge Result

Set Name Easy All
Score / Max Score 50 / 50 50 / 50
Status
AC × 15
AC × 51
Set Name Test Cases
Easy easy-000.txt, easy-001.txt, easy-002.txt, easy-003.txt, easy-004.txt, easy-005.txt, easy-006.txt, easy-007.txt, easy-008.txt, easy-009.txt, easy-010.txt, easy-011.txt, easy-012.txt, easy-013.txt, easy-014.txt
All easy-000.txt, easy-001.txt, easy-002.txt, easy-003.txt, easy-004.txt, easy-005.txt, easy-006.txt, easy-007.txt, easy-008.txt, easy-009.txt, easy-010.txt, easy-011.txt, easy-012.txt, easy-013.txt, easy-014.txt, hard-000.txt, hard-001.txt, hard-002.txt, hard-003.txt, hard-004.txt, hard-005.txt, hard-006.txt, hard-007.txt, hard-008.txt, hard-009.txt, hard-010.txt, hard-011.txt, hard-012.txt, hard-013.txt, hard-014.txt, hard-015.txt, hard-016.txt, hard-017.txt, hard-018.txt, hard-019.txt, hard-020.txt, hard-021.txt, hard-022.txt, hard-023.txt, hard-024.txt, hard-025.txt, hard-026.txt, hard-027.txt, hard-028.txt, hard-029.txt, hard-030.txt, hard-031.txt, hard-032.txt, hard-033.txt, hard-034.txt, hard-035.txt
Case Name Status Exec Time Memory
easy-000.txt AC 20 ms 772 KB
easy-001.txt AC 20 ms 796 KB
easy-002.txt AC 20 ms 792 KB
easy-003.txt AC 20 ms 792 KB
easy-004.txt AC 20 ms 788 KB
easy-005.txt AC 20 ms 776 KB
easy-006.txt AC 20 ms 788 KB
easy-007.txt AC 20 ms 792 KB
easy-008.txt AC 20 ms 784 KB
easy-009.txt AC 20 ms 788 KB
easy-010.txt AC 19 ms 780 KB
easy-011.txt AC 20 ms 780 KB
easy-012.txt AC 20 ms 788 KB
easy-013.txt AC 20 ms 812 KB
easy-014.txt AC 20 ms 784 KB
hard-000.txt AC 20 ms 700 KB
hard-001.txt AC 20 ms 788 KB
hard-002.txt AC 20 ms 784 KB
hard-003.txt AC 20 ms 780 KB
hard-004.txt AC 20 ms 788 KB
hard-005.txt AC 20 ms 780 KB
hard-006.txt AC 19 ms 788 KB
hard-007.txt AC 20 ms 792 KB
hard-008.txt AC 20 ms 792 KB
hard-009.txt AC 20 ms 632 KB
hard-010.txt AC 20 ms 784 KB
hard-011.txt AC 20 ms 792 KB
hard-012.txt AC 20 ms 784 KB
hard-013.txt AC 20 ms 784 KB
hard-014.txt AC 20 ms 780 KB
hard-015.txt AC 20 ms 780 KB
hard-016.txt AC 19 ms 792 KB
hard-017.txt AC 20 ms 792 KB
hard-018.txt AC 23 ms 796 KB
hard-019.txt AC 20 ms 776 KB
hard-020.txt AC 19 ms 784 KB
hard-021.txt AC 20 ms 784 KB
hard-022.txt AC 19 ms 792 KB
hard-023.txt AC 20 ms 820 KB
hard-024.txt AC 20 ms 788 KB
hard-025.txt AC 20 ms 788 KB
hard-026.txt AC 20 ms 784 KB
hard-027.txt AC 20 ms 788 KB
hard-028.txt AC 20 ms 784 KB
hard-029.txt AC 19 ms 788 KB
hard-030.txt AC 20 ms 692 KB
hard-031.txt AC 20 ms 776 KB
hard-032.txt AC 20 ms 700 KB
hard-033.txt AC 20 ms 780 KB
hard-034.txt AC 20 ms 784 KB
hard-035.txt AC 20 ms 784 KB
sample1.txt AC 20 ms 784 KB
sample2.txt AC 20 ms 784 KB
sample3.txt AC 20 ms 792 KB