QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#309945 | #8132. Freshman's Dream | ucup-team1266# | WA | 63ms | 3668kb | C++20 | 662b | 2024-01-20 22:56:22 | 2024-01-20 22:56:22 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
const int MAX = 4e5 + 10, mod = 998244353;
ll n;
void solve(){
cin >> n;
if (n & 1){
cout << -1 << endl;return;
}
int k;
for (int i = 0; i < 60; ++ i){
if ((1ll << i) > n){k = i;goto end;}
}
cout << -1 << endl;
return;
end:cout << n / 2 << ' ' << (1ll << k) - n / 2 << endl;
}
signed main(){
//ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//cout << fixed << setprecision(7);
int _;cin>>_;while (_ --)
solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3648kb
input:
5 2 3 6 10 18
output:
1 3 -1 3 5 5 11 9 23
result:
ok ok
Test #2:
score: 0
Accepted
time: 39ms
memory: 3668kb
input:
100000 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
1 3 -1 2 6 -1 3 5 -1 4 12 -1 5 11 -1 6 10 -1 7 9 -1 8 24 -1 9 23 -1 10 22 -1 11 21 -1 12 20 -1 13 19 -1 14 18 -1 15 17 -1 16 48 -1 17 47 -1 18 46 -1 19 45 -1 20 44 -1 21 43 -1 22 42 -1 23 41 -1 24 40 -1 25 39 -1 26 38 -1 27 37 -1 28 36 -1 29 35 -1 30 34 -1 31 33 -1 32 96 -1 33 95 -1 34 94 -1 35 93 -...
result:
ok ok
Test #3:
score: 0
Accepted
time: 52ms
memory: 3596kb
input:
100000 76316 55087 1035148 480523 322879 607749 440658 434700 941531 657517 247448 953385 569641 592597 188131 769378 397552 94739 487375 142576 407344 532339 798526 521099 294428 414998 415977 646853 941103 21816 299379 1029240 171218 784108 711027 121363 223925 197035 899124 613355 178257 213375 3...
output:
38158 92914 -1 517574 531002 -1 -1 -1 220329 303959 217350 306938 -1 -1 123724 138420 -1 -1 -1 -1 384689 663887 198776 325512 -1 -1 71288 190856 203672 320616 -1 399263 649313 -1 147214 377074 207499 316789 -1 -1 -1 10908 21860 -1 514620 533956 85609 176535 392054 656522 -1 -1 -1 -1 449562 599014 -1...
result:
ok ok
Test #4:
score: 0
Accepted
time: 63ms
memory: 3544kb
input:
100000 279938093875 699023415517 1048269983590 537007992988 908117019805 683806387338 334400705624 484515916103 888494261285 220468538805 253319179778 357268673752 644637898889 919322454545 854350801341 1022830170092 486578580191 750669735889 4206967959 937169662800 852140555915 924210466276 2534095...
output:
-1 -1 524134991795 575376635981 268503996494 281251817394 -1 341903193669 757608434107 167200352812 382555461076 -1 -1 -1 126659589889 148218317055 178634336876 371121477012 -1 -1 -1 511415085046 588096542730 -1 -1 -1 468584831400 630926796376 -1 462105233138 637406394638 126704791299 148173115645 4...
result:
ok ok
Test #5:
score: -100
Wrong Answer
time: 56ms
memory: 3600kb
input:
100000 1040995214518856201 963834979320064344 718413469456747239 720594233881658007 133510227004253867 342816554559204856 24244360004792499 32003367585596768 68757795892900724 211638297745299764 478782413658379896 503496146580989968 288072253164348517 131667719615682949 186429177128265488 6043925869...
output:
-1 -1 -1 -1 -1 171408277279602428 405052475023821060 -1 16001683792798384 20027113226165584 34378897946450362 37678696091477574 105819148872649882 182411227279061862 239391206829189948 337069545474233540 251748073290494984 324712679012928504 -1 -1 93214588564132744 195015787587579000 -1 -1 190960544...
result:
wrong answer jury has answer but participant doesn't