QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#402180#1079. Overlapping Mapsstasio6#AC ✓1ms3892kbC++141.1kb2024-04-30 05:29:392024-04-30 05:29:41

Judging History

你现在查看的是最新测评结果

  • [2024-04-30 05:29:41]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3892kb
  • [2024-04-30 05:29:39]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define rep(i,a,b) for(int i = a; i < (b); i++)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define PB push_back
#define FS first
#define SD second
typedef pair<int, int> pii;
typedef vector<int> vi;
template<class X, class Y> X cmx(X &a, Y b) { a = max<X>(a, b); }
#define ary(k) array<int, k>

signed main() {
	cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit);
    while (true) {
        int w, h, px, py, ss, r;
        cin >> w >> h >> px >> py >> ss >> r;
        if (w == 0)
            break;
        double rad = r;
        rad /= 360;
        rad *= 2 * M_PI;
        double s = ss;
        s /= 100;
        double d1 = cos(rad), d2 = sin(rad);
//        cerr << rad << " " << s << " " << d1 << " " << d2 << "\n";
        double detA = (s * d1 - 1) * (s * d1 - 1) + (s * d2) * (s * d2);
        double detAx = -px * (s * d1 - 1) - py * s * d2;
        double detAy = -py * (s * d1 - 1) + px * s * d2;
        cout << fixed << setprecision(2) << detAx / detA << " " << detAy / detA << "\n";
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3892kb

input:

100 100 50 50 25 0
100 100 50 50 25 45
1000 1000 1 1 99 0
1000 1000 1 1 1 0
1000 1000 999 999 1 180
683 766 655 499 7 57
261 846 38 380 56 359
271 414 119 259 50 8
489 655 249 308 47 4
355 577 120 431 18 43
636 405 36 173 3 149
120 861 103 588 2 151
491 138 24 68 36 357
919 811 352 451 44 36
253 282...

output:

66.67 66.67
45.59 70.53
100.00 100.00
1.01 1.01
989.11 989.11
646.89 558.26
105.47 861.13
161.92 535.33
431.36 606.51
66.69 505.77
32.55 169.15
95.71 578.80
40.56 104.98
228.50 792.03
81.19 336.56
183.53 292.61
235.87 48.34
278.77 469.53
330.91 89.62
81.87 24.17
154.22 212.88
54.04 251.65
241.66 299...

result:

ok 455 lines