QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#108884 | #5699. 单调上升路径 | myee | 100 ✓ | 24ms | 2496kb | C++11 | 1.6kb | 2023-05-26 21:02:12 | 2023-05-26 21:05:35 |
Judging History
answer
// 那就是希望。
// 即便需要取模,也是光明。
// 不会构造。/kel
// 太智慧了。
#include <algorithm>
#include <stdio.h>
#include <vector>
typedef long long llt;
typedef unsigned uint;typedef unsigned long long ullt;
typedef bool bol;typedef char chr;typedef void voi;
typedef double dbl;
template<typename T>bol _max(T&a,T b){return(a<b)?a=b,true:false;}
template<typename T>bol _min(T&a,T b){return(b<a)?a=b,true:false;}
template<typename T>T lowbit(T n){return n&-n;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T>T lcm(T a,T b){return(a!=0||b!=0)?a/gcd(a,b)*b:(T)0;}
template<typename T>T exgcd(T a,T b,T&x,T&y){if(b!=0){T ans=exgcd(b,a%b,y,x);y-=a/b*x;return ans;}else return y=0,x=1,a;}
template<typename T>T power(T base,T index,T mod)
{
T ans=1%mod;
while(index)
{
if(index&1)ans=ans*base%mod;
base=base*base%mod,index>>=1;
}
return ans;
}
uint A[505][505];
int main()
{
#ifdef MYEE
freopen("QAQ.in","r",stdin);
// freopen("QAQ.out","w",stdout);
#endif
uint n;scanf("%u",&n);
for(uint i=0,cnt=0;i<n-1;i++){
A[i][n-1]=++cnt;
for(uint j=1;j<n/2;j++)
{
uint x=(i+j)%(n-1),y=(i+n-1-j)%(n-1);
A[std::min(x,y)][std::max(x,y)]=++cnt;
}
}
for(uint i=0;i<n;i++)for(uint j=i+1;j<n;j++)
printf("%u%c",A[i][j]," \n"[j==n-1]);
// for(uint i=0;i<n;i++)for(uint j=i+1;j<n;j++)
// printf("%u %u %u\n",i+1,j+1,A[i][j]);
return 0;
}
// 那就是希望。
// 即便需要取模,也是光明。
详细
Test #1:
score: 10
Accepted
time: 1ms
memory: 1740kb
input:
8
output:
20 6 23 11 26 16 1 24 10 27 15 2 5 28 14 3 19 9 4 18 7 13 8 22 17 12 21 25
result:
ok your answer is completely correct
Test #2:
score: 10
Accepted
time: 2ms
memory: 1744kb
input:
18
output:
90 11 98 21 106 31 114 41 122 51 130 61 138 71 146 81 1 99 20 107 30 115 40 123 50 131 60 139 70 147 80 2 10 108 29 116 39 124 49 132 59 140 69 148 79 3 89 19 117 38 125 48 133 58 141 68 149 78 4 88 12 28 126 47 134 57 142 67 150 77 5 87 13 97 37 135 56 143 66 151 76 6 86 14 96 22 46 144 65 152 75 7...
result:
ok your answer is completely correct
Test #3:
score: 10
Accepted
time: 2ms
memory: 1760kb
input:
42
output:
462 23 482 45 502 67 522 89 542 111 562 133 582 155 602 177 622 199 642 221 662 243 682 265 702 287 722 309 742 331 762 353 782 375 802 397 822 419 842 441 1 483 44 503 66 523 88 543 110 563 132 583 154 603 176 623 198 643 220 663 242 683 264 703 286 723 308 743 330 763 352 783 374 803 396 823 418 8...
result:
ok your answer is completely correct
Test #4:
score: 10
Accepted
time: 2ms
memory: 1756kb
input:
72
output:
1332 38 1367 75 1402 112 1437 149 1472 186 1507 223 1542 260 1577 297 1612 334 1647 371 1682 408 1717 445 1752 482 1787 519 1822 556 1857 593 1892 630 1927 667 1962 704 1997 741 2032 778 2067 815 2102 852 2137 889 2172 926 2207 963 2242 1000 2277 1037 2312 1074 2347 1111 2382 1148 2417 1185 2452 122...
result:
ok your answer is completely correct
Test #5:
score: 10
Accepted
time: 3ms
memory: 1724kb
input:
100
output:
2550 52 2599 103 2648 154 2697 205 2746 256 2795 307 2844 358 2893 409 2942 460 2991 511 3040 562 3089 613 3138 664 3187 715 3236 766 3285 817 3334 868 3383 919 3432 970 3481 1021 3530 1072 3579 1123 3628 1174 3677 1225 3726 1276 3775 1327 3824 1378 3873 1429 3922 1480 3971 1531 4020 1582 4069 1633 ...
result:
ok your answer is completely correct
Test #6:
score: 10
Accepted
time: 5ms
memory: 1908kb
input:
198
output:
9900 101 9998 201 10096 301 10194 401 10292 501 10390 601 10488 701 10586 801 10684 901 10782 1001 10880 1101 10978 1201 11076 1301 11174 1401 11272 1501 11370 1601 11468 1701 11566 1801 11664 1901 11762 2001 11860 2101 11958 2201 12056 2301 12154 2401 12252 2501 12350 2601 12448 2701 12546 2801 126...
result:
ok your answer is completely correct
Test #7:
score: 10
Accepted
time: 10ms
memory: 2132kb
input:
296
output:
22052 150 22199 299 22346 448 22493 597 22640 746 22787 895 22934 1044 23081 1193 23228 1342 23375 1491 23522 1640 23669 1789 23816 1938 23963 2087 24110 2236 24257 2385 24404 2534 24551 2683 24698 2832 24845 2981 24992 3130 25139 3279 25286 3428 25433 3577 25580 3726 25727 3875 25874 4024 26021 417...
result:
ok your answer is completely correct
Test #8:
score: 10
Accepted
time: 15ms
memory: 2336kb
input:
394
output:
39006 199 39202 397 39398 595 39594 793 39790 991 39986 1189 40182 1387 40378 1585 40574 1783 40770 1981 40966 2179 41162 2377 41358 2575 41554 2773 41750 2971 41946 3169 42142 3367 42338 3565 42534 3763 42730 3961 42926 4159 43122 4357 43318 4555 43514 4753 43710 4951 43906 5149 44102 5347 44298 55...
result:
ok your answer is completely correct
Test #9:
score: 10
Accepted
time: 24ms
memory: 2496kb
input:
490
output:
60270 247 60514 493 60758 739 61002 985 61246 1231 61490 1477 61734 1723 61978 1969 62222 2215 62466 2461 62710 2707 62954 2953 63198 3199 63442 3445 63686 3691 63930 3937 64174 4183 64418 4429 64662 4675 64906 4921 65150 5167 65394 5413 65638 5659 65882 5905 66126 6151 66370 6397 66614 6643 66858 6...
result:
ok your answer is completely correct
Test #10:
score: 10
Accepted
time: 24ms
memory: 2496kb
input:
498
output:
62250 251 62498 501 62746 751 62994 1001 63242 1251 63490 1501 63738 1751 63986 2001 64234 2251 64482 2501 64730 2751 64978 3001 65226 3251 65474 3501 65722 3751 65970 4001 66218 4251 66466 4501 66714 4751 66962 5001 67210 5251 67458 5501 67706 5751 67954 6001 68202 6251 68450 6501 68698 6751 68946 ...
result:
ok your answer is completely correct
Extra Test:
score: 0
Extra Test Passed