Submission #371323


Source Code Expand

#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<numeric>
#include<functional>
#include<complex>
#include<cassert>

using namespace std;
#define BET(a,b,c) ((a)<=(b)&&(b)<(c))
#define FOR(i,n) for(int i=0,i##_end=(int(n));i<i##_end;i++)
#define SZ(x) (int)(x.size())
#define ALL(x) (x).begin(),(x).end()
#define MP make_pair
typedef long long ll_t;
typedef long double ld_t;
typedef vector<int> VI;
typedef vector<VI> VVI;

typedef complex<int> xy;

int main()
{
    double x, y;
    cin>>x>>y;
    long long X = x * 1000, Y = y * 1000;
    if(X % 1000 == 0 && Y % 1000 == 0) {
        long long px = X / 1000;
        long long py = Y / 1000;
        cout<<px<<" "<<py<<" "<<px+1<<" "<<py<<endl;
        cout<<px<<" "<<py<<" "<<px<<" "<<py+1<<endl;
    }else {
        {
            long long dx = 1000 - X % 1000;
            long long dy = 1000 - Y % 1000;
            if(dx == 0) dx += 1000;
            if(dy == 0) dy += 1000;
            assert((X + dx) % 1000 == 0);
            assert((Y + dy) % 1000 == 0);
            long long px = (X + dx) / 1000;
            long long py = (Y + dy) / 1000;
            long long qx = (X + dx + dx * 1000) / 1000;
            long long qy = (Y + dy + dy * 1000) / 1000;
            cout<<px<<" "<<py<<" "<<qx<<" "<<qy<<endl;
        }
        {
            long long dx = 1000 - X % 1000;
            long long dy = 1000 - Y % 1000;
            if(dx == 0) dx += 1000;
            if(dy == 0) dy += 1000;
            dy += 1000;
            assert((X + dx) % 1000 == 0);
            assert((Y + dy) % 1000 == 0);
            long long px = (X + dx) / 1000;
            long long py = (Y + dy) / 1000;
            long long qx = (X + dx + dx * 1000) / 1000;
            long long qy = (Y + dy + dy * 1000) / 1000;
            cout<<px<<" "<<py<<" "<<qx<<" "<<qy<<endl;
        }
    }
    return 0;
}

Submission Info

Submission Time
Task B - 交点
User EmK
Language C++11 (GCC 4.9.2)
Score 0
Code Size 2079 Byte
Status WA
Exec Time 31 ms
Memory 932 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 25
WA × 2
Set Name Test Cases
All scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt, scrambled_19.txt, scrambled_20.txt, scrambled_21.txt, scrambled_22.txt, scrambled_23.txt, scrambled_24.txt, scrambled_25.txt, scrambled_26.txt
Case Name Status Exec Time Memory
scrambled_00.txt AC 25 ms 808 KB
scrambled_01.txt AC 25 ms 800 KB
scrambled_02.txt AC 25 ms 924 KB
scrambled_03.txt AC 25 ms 920 KB
scrambled_04.txt AC 25 ms 928 KB
scrambled_05.txt AC 25 ms 732 KB
scrambled_06.txt AC 25 ms 804 KB
scrambled_07.txt AC 25 ms 928 KB
scrambled_08.txt AC 25 ms 804 KB
scrambled_09.txt AC 25 ms 932 KB
scrambled_10.txt AC 25 ms 924 KB
scrambled_11.txt AC 25 ms 912 KB
scrambled_12.txt AC 25 ms 796 KB
scrambled_13.txt AC 25 ms 924 KB
scrambled_14.txt AC 24 ms 676 KB
scrambled_15.txt AC 25 ms 804 KB
scrambled_16.txt AC 26 ms 808 KB
scrambled_17.txt AC 24 ms 796 KB
scrambled_18.txt AC 25 ms 804 KB
scrambled_19.txt AC 26 ms 804 KB
scrambled_20.txt AC 25 ms 800 KB
scrambled_21.txt AC 31 ms 928 KB
scrambled_22.txt AC 23 ms 928 KB
scrambled_23.txt AC 27 ms 776 KB
scrambled_24.txt AC 25 ms 732 KB
scrambled_25.txt WA 26 ms 924 KB
scrambled_26.txt WA 23 ms 840 KB