QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#850156 | #9663. Reverse Pairs Coloring | zhenjianuo2025 | AC ✓ | 82ms | 25512kb | C++20 | 2.4kb | 2025-01-09 20:57:35 | 2025-01-09 20:57:36 |
Judging History
answer
#include<bits/stdc++.h>
bool Mbg;
using namespace std;
#define vec vector
#define pb push_back
#define eb emplace_back
#define siz(vec) ((int)(vec).size())
#define all(vec) (vec).begin(),(vec).end()
template<class T>
void operator +=(vec<T> &a,T b){a.push_back(b);}
template<class T>
void operator --(vec<T> &a){a.pop_back();}
#define pii pair<int,int>
#define x first
#define y second
#define mp make_pair
#define exc(exp) if(exp)continue;
#define stop(exp) if(exp)break;
#define ret(exp) if(exp)return;
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define debl(var) cerr<<#var<<'='<<(var)<<";\n"
#define ins insert
#define era erase
#define lb lower_bound
#define ub upper_bound
#define int long long
#define inf (long long)(1e18)
template<class T>
bool Min(T &x,T y){return x>y?x=y,1:0;}
template<class T>
bool Max(T &x,T y){return x<y?x=y,1:0;}
const int mod=998244353;
void Add(int &x,int y){x=x+y<mod?x+y:x+y-mod;}
void Dec(int &x,int y){x=x>=y?x-y:x-y+mod;}
int fpm(int x,int y){
int ans=1;for(;y;y>>=1,x=1ll*x*x%mod)if(y&1)ans=1ll*x*ans%mod;return ans;
}
int n,p[300010],q[300010],ans;
struct BIT{
int w[300010];
void add(int i,int x){
for(;i<=n;i+=i&(-i))w[i]+=x;
}
int qry(int i){
int x=0;for(;i;i-=i&(-i))x+=w[i];return x;
}
}bit;
vec<int> U[300010];
void work(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>p[i];
q[p[i]]=i;
}
// for(int i=1;i<=n;i++){
// for(int j=1;j<=n;j++){
// if(j<p[i]&&i<q[j]&&q[j-1]<i&&p[i-1]<j){
// ++ans;
// }
// }
// }
for(int j=1;j<=n;j++){
if(q[j-1]+1<q[j]){
U[q[j-1]+1]+=j;
U[q[j]]+=-j;
}
}
for(int i=1;i<=n;i++){
for(auto j:U[i]){
if(j>0)
bit.add(j,1);
else
bit.add(-j,-1);
}
if(p[i-1]+1<p[i])
ans+=bit.qry(p[i]-1)-bit.qry(p[i-1]);
}
cout<<ans<<'\n';
}
bool Med;
signed main(){
ios::sync_with_stdio(0),
cin.tie(0),cout.tie(0);
int T=1;while(T--)work();
// cerr<<"Time: "<<clock()<<" ms;\n";
// cerr<<"Memory: "<<abs(&Med-&Mbg)/1024.0/1024.0<<" MiB.\n";
}
/*
- CONTINUE, NON-STOPPING, FOR THE FAITH
- START TYPING IF YOU DON'T KNOW WHAT TO DO
- STOP TYPING IF YOU DON'T KNOW WHAT YOU'RE DOING
*/
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 9696kb
input:
9 5 9 1 8 2 6 4 7 3
output:
5
result:
ok single line: '5'
Test #2:
score: 0
Accepted
time: 0ms
memory: 7724kb
input:
2 1 2
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 2ms
memory: 9716kb
input:
2 2 1
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 9656kb
input:
12 12 11 10 9 8 7 6 5 4 3 2 1
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 0ms
memory: 9720kb
input:
12 2 5 3 7 1 12 11 9 8 4 10 6
output:
8
result:
ok single line: '8'
Test #6:
score: 0
Accepted
time: 1ms
memory: 7608kb
input:
12 1 2 3 4 5 6 7 8 9 10 11 12
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 1ms
memory: 9660kb
input:
144 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61...
output:
1
result:
ok single line: '1'
Test #8:
score: 0
Accepted
time: 0ms
memory: 9760kb
input:
144 78 106 141 21 115 2 14 64 124 91 117 121 30 99 144 55 94 137 38 27 40 72 59 46 50 109 84 15 87 108 52 23 74 4 140 70 63 58 105 113 77 10 35 66 130 34 96 86 16 65 12 92 83 5 95 36 45 8 79 132 75 57 98 93 119 125 26 18 136 127 73 90 3 123 53 139 142 37 103 24 133 111 143 67 76 43 114 42 44 135 22 ...
output:
699
result:
ok single line: '699'
Test #9:
score: 0
Accepted
time: 1ms
memory: 7652kb
input:
144 1 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:
0
result:
ok single line: '0'
Test #10:
score: 0
Accepted
time: 2ms
memory: 9704kb
input:
1728 1728 1727 1726 1725 1724 1723 1722 1721 1720 1719 1718 1717 1716 1715 1714 1713 1712 1711 1710 1709 1708 1707 1706 1705 1704 1703 1702 1701 1700 1699 1698 1697 1696 1695 1694 1693 1692 1691 1690 1689 1688 1687 1686 1685 1684 1683 1682 1681 1680 1679 1678 1677 1676 1675 1674 1673 1672 1671 1670 ...
output:
1
result:
ok single line: '1'
Test #11:
score: 0
Accepted
time: 2ms
memory: 9872kb
input:
1728 802 233 421 541 844 722 70 119 697 499 1699 1323 1537 1053 551 1125 736 686 1378 630 1070 192 1650 652 291 1182 1405 848 684 1557 100 1704 329 504 611 795 1242 1548 680 1355 1693 66 479 1194 607 316 913 1343 276 701 78 737 279 804 1438 30 754 1115 745 1017 767 1046 920 683 988 1494 501 669 1658...
output:
83738
result:
ok single line: '83738'
Test #12:
score: 0
Accepted
time: 0ms
memory: 7788kb
input:
1728 1 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:
0
result:
ok single line: '0'
Test #13:
score: 0
Accepted
time: 2ms
memory: 9664kb
input:
20736 20736 20735 20734 20733 20732 20731 20730 20729 20728 20727 20726 20725 20724 20723 20722 20721 20720 20719 20718 20717 20716 20715 20714 20713 20712 20711 20710 20709 20708 20707 20706 20705 20704 20703 20702 20701 20700 20699 20698 20697 20696 20695 20694 20693 20692 20691 20690 20689 20688 ...
output:
1
result:
ok single line: '1'
Test #14:
score: 0
Accepted
time: 5ms
memory: 10792kb
input:
20736 15428 2928 14988 4279 13247 8077 8128 5263 19240 2440 3234 3008 9868 13229 657 14625 7333 17930 9043 1743 3440 7846 5030 10290 14958 1451 9866 13357 3826 15385 7304 4033 12973 16937 131 5361 2814 6706 2681 5908 9738 15648 4911 18164 12531 10392 5428 6612 15193 9154 11479 8291 1187 1136 6330 10...
output:
11906581
result:
ok single line: '11906581'
Test #15:
score: 0
Accepted
time: 0ms
memory: 7724kb
input:
20736 1 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 10...
output:
0
result:
ok single line: '0'
Test #16:
score: 0
Accepted
time: 15ms
memory: 11152kb
input:
248832 248832 248831 248830 248829 248828 248827 248826 248825 248824 248823 248822 248821 248820 248819 248818 248817 248816 248815 248814 248813 248812 248811 248810 248809 248808 248807 248806 248805 248804 248803 248802 248801 248800 248799 248798 248797 248796 248795 248794 248793 248792 248791...
output:
1
result:
ok single line: '1'
Test #17:
score: 0
Accepted
time: 63ms
memory: 22496kb
input:
248832 124869 135755 12850 214130 145599 75073 35346 33333 87655 46111 222853 201944 54979 230688 13628 144356 233045 217207 157626 123582 209484 242708 191577 173182 117845 10771 93744 56439 163427 46992 103372 174039 150400 177984 244446 58937 188383 31124 16092 128575 38724 34774 204536 75835 218...
output:
1722641914
result:
ok single line: '1722641914'
Test #18:
score: 0
Accepted
time: 14ms
memory: 8088kb
input:
248832 1 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 1...
output:
0
result:
ok single line: '0'
Test #19:
score: 0
Accepted
time: 9ms
memory: 10232kb
input:
300000 300000 299999 299998 299997 299996 299995 299994 299993 299992 299991 299990 299989 299988 299987 299986 299985 299984 299983 299982 299981 299980 299979 299978 299977 299976 299975 299974 299973 299972 299971 299970 299969 299968 299967 299966 299965 299964 299963 299962 299961 299960 299959...
output:
1
result:
ok single line: '1'
Test #20:
score: 0
Accepted
time: 82ms
memory: 25512kb
input:
300000 239415 50154 20266 131115 94234 36028 102103 163828 247232 288414 191935 70446 292328 101071 278663 149866 15685 291862 236268 78373 298325 130058 200948 182893 276807 219715 33136 269040 46221 48212 250438 121345 179565 46706 177889 240176 94461 152264 78126 50364 161649 258824 265439 203657...
output:
2502054663
result:
ok single line: '2502054663'
Test #21:
score: 0
Accepted
time: 16ms
memory: 8344kb
input:
300000 1 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 1...
output:
0
result:
ok single line: '0'
Test #22:
score: 0
Accepted
time: 18ms
memory: 13804kb
input:
300000 1 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 1...
output:
110520823
result:
ok single line: '110520823'
Test #23:
score: 0
Accepted
time: 20ms
memory: 11540kb
input:
299999 1 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 1...
output:
17730774
result:
ok single line: '17730774'
Test #24:
score: 0
Accepted
time: 13ms
memory: 12024kb
input:
299998 1 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 1...
output:
20981055
result:
ok single line: '20981055'
Test #25:
score: 0
Accepted
time: 37ms
memory: 20288kb
input:
300000 1 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 1...
output:
150603720
result:
ok single line: '150603720'
Test #26:
score: 0
Accepted
time: 31ms
memory: 19124kb
input:
299999 1 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 1...
output:
91305765
result:
ok single line: '91305765'
Test #27:
score: 0
Accepted
time: 25ms
memory: 17480kb
input:
299998 1 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 1...
output:
60403678
result:
ok single line: '60403678'
Test #28:
score: 0
Accepted
time: 28ms
memory: 18988kb
input:
300000 1 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 1...
output:
4278147
result:
ok single line: '4278147'
Test #29:
score: 0
Accepted
time: 23ms
memory: 19512kb
input:
299999 1 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 1...
output:
4741668
result:
ok single line: '4741668'
Test #30:
score: 0
Accepted
time: 32ms
memory: 18876kb
input:
299998 1 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 1...
output:
4366163
result:
ok single line: '4366163'
Test #31:
score: 0
Accepted
time: 29ms
memory: 21768kb
input:
300000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 48 23 47 42 40 45 30 44 37 35 33 43 22 29 31 39 41 26 25 34 38 24 46 32 27 36 28 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 82 99 87 80 77 85 94 97 91 95 98 89 86 84 96 78 88 81 79 101 83 93 100 90 ...
output:
264124
result:
ok single line: '264124'
Test #32:
score: 0
Accepted
time: 33ms
memory: 21816kb
input:
299999 1 8 13 24 12 6 17 9 16 10 21 14 19 20 25 23 11 7 2 22 18 3 15 5 4 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 1...
output:
274653
result:
ok single line: '274653'
Test #33:
score: 0
Accepted
time: 30ms
memory: 21720kb
input:
299998 1 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 41 32 34 37 33 38 31 35 39 42 36 40 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 72 67 66 74 65 68 81 94 87 100 64 73 70 88 63 71 59 76 61 83 75 106 92 90 77 60 103 62 97 85 82 98 69 99 86 93 84 80 101 89 104 ...
output:
276918
result:
ok single line: '276918'
Test #34:
score: 0
Accepted
time: 28ms
memory: 22800kb
input:
300000 1 5 3 4 2 6 8 7 9 10 11 13 12 14 18 17 16 15 19 21 20 23 22 26 25 24 27 28 29 30 31 32 33 36 34 35 38 41 39 37 42 40 43 44 45 46 49 47 48 50 51 52 54 53 55 56 58 61 57 59 60 62 63 64 65 68 66 67 71 69 70 72 73 74 76 75 77 78 80 79 81 82 85 84 83 87 90 89 86 88 92 91 95 93 94 96 98 97 101 100 ...
output:
64559
result:
ok single line: '64559'
Test #35:
score: 0
Accepted
time: 32ms
memory: 22740kb
input:
299999 1 2 5 3 4 6 8 7 10 9 11 12 14 13 15 16 17 18 19 20 21 22 23 27 28 25 26 24 29 30 31 33 32 35 34 36 37 38 39 40 42 41 43 44 46 45 47 49 48 50 51 52 53 54 55 57 56 58 59 60 62 61 63 64 65 66 67 70 69 68 72 71 74 73 75 76 77 80 78 79 84 82 85 83 81 86 87 88 89 91 90 92 93 94 95 96 97 98 99 101 1...
output:
64793
result:
ok single line: '64793'
Test #36:
score: 0
Accepted
time: 31ms
memory: 22804kb
input:
299998 1 3 2 4 5 7 6 8 9 16 10 11 15 12 13 14 17 18 20 19 21 24 23 22 25 26 27 28 29 31 30 32 33 34 35 36 37 38 40 39 41 42 43 45 44 46 48 47 49 50 51 52 53 55 54 56 57 59 58 61 60 62 65 63 64 66 67 68 71 70 69 72 73 74 76 75 77 78 79 81 80 82 83 84 85 86 92 89 87 93 94 90 91 88 95 97 99 98 96 100 1...
output:
64978
result:
ok single line: '64978'
Test #37:
score: 0
Accepted
time: 25ms
memory: 22388kb
input:
300000 2 1 3 4 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 23 24 26 25 28 27 29 30 32 31 34 33 35 36 38 37 40 39 42 41 44 43 45 46 48 47 50 49 51 52 53 54 55 56 58 57 59 60 62 61 63 64 65 66 67 68 69 70 71 72 74 73 76 75 78 77 79 80 81 82 84 83 86 85 87 88 90 89 92 91 93 94 96 95 97 98 99 100 1...
output:
75227
result:
ok single line: '75227'
Test #38:
score: 0
Accepted
time: 33ms
memory: 22388kb
input:
299999 2 1 4 3 6 5 7 8 10 9 12 11 13 14 15 16 17 18 19 20 22 21 23 24 25 26 28 27 29 30 31 32 34 33 35 36 37 38 40 39 42 41 43 44 46 45 47 48 49 50 52 51 53 54 56 55 58 57 60 59 62 61 64 63 66 65 68 67 69 70 72 71 73 74 76 75 78 77 80 79 81 82 84 83 86 85 88 87 90 89 91 92 93 94 95 96 97 98 99 100 1...
output:
75181
result:
ok single line: '75181'
Test #39:
score: 0
Accepted
time: 18ms
memory: 22356kb
input:
299998 2 1 3 4 6 5 8 7 10 9 12 11 13 14 16 15 18 17 20 19 22 21 24 23 25 26 27 28 29 30 31 32 33 34 36 35 38 37 40 39 42 41 43 44 46 45 48 47 49 50 52 51 54 53 56 55 58 57 59 60 62 61 64 63 66 65 67 68 69 70 71 72 73 74 76 75 78 77 79 80 81 82 84 83 86 85 88 87 89 90 92 91 94 93 96 95 98 97 100 99 1...
output:
75078
result:
ok single line: '75078'
Test #40:
score: 0
Accepted
time: 26ms
memory: 14388kb
input:
300000 1 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 1...
output:
110381728
result:
ok single line: '110381728'
Test #41:
score: 0
Accepted
time: 35ms
memory: 20112kb
input:
300000 1 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 1...
output:
181841683
result:
ok single line: '181841683'
Test #42:
score: 0
Accepted
time: 21ms
memory: 15652kb
input:
300000 1 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 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 92...
output:
2097809
result:
ok single line: '2097809'
Test #43:
score: 0
Accepted
time: 25ms
memory: 20132kb
input:
300000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 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 1...
output:
152347
result:
ok single line: '152347'
Test #44:
score: 0
Accepted
time: 30ms
memory: 23424kb
input:
300000 1 2 3 4 5 6 9 8 7 10 11 12 14 13 18 17 16 15 19 21 20 25 24 23 22 27 26 28 29 34 33 32 31 30 35 36 37 40 39 38 41 44 43 42 45 46 48 47 51 50 49 53 52 55 54 56 57 58 59 60 61 63 62 68 67 66 65 64 71 70 69 72 73 74 77 76 75 78 79 80 81 82 83 84 86 85 87 90 89 88 91 93 92 94 95 96 97 99 98 100 1...
output:
74153
result:
ok single line: '74153'
Test #45:
score: 0
Accepted
time: 21ms
memory: 22296kb
input:
300000 300000 150000 299999 149998 299998 149996 299997 149994 299996 149992 299995 149990 299994 149988 299993 149986 299992 149984 299991 149982 299990 149980 299989 149978 299988 149976 299987 149974 299986 149972 299985 149970 299984 149968 299983 149966 299982 149964 299981 149962 299980 149960...
output:
2812612499
result:
ok single line: '2812612499'
Test #46:
score: 0
Accepted
time: 22ms
memory: 22316kb
input:
299999 299999 150000 299998 149998 299997 149996 299996 149994 299995 149992 299994 149990 299993 149988 299992 149986 299991 149984 299990 149982 299989 149980 299988 149978 299987 149976 299986 149974 299985 149972 299984 149970 299983 149968 299982 149966 299981 149964 299980 149962 299979 149960...
output:
2812612498
result:
ok single line: '2812612498'
Extra Test:
score: 0
Extra Test Passed