QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#388546#5699. 单调上升路径bachbeo2007100 ✓6ms5704kbC++202.1kb2024-04-13 16:48:592024-04-13 16:49:00

Judging History

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

  • [2024-04-13 16:49:00]
  • 评测
  • 测评结果:100
  • 用时:6ms
  • 内存:5704kb
  • [2024-04-13 16:48:59]
  • 提交

answer

// Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_supports("avx2"));
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
// Atcoder
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma")
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
- insert(x),erase(x)
- find_by_order(k): return iterator to the k-th smallest element
- order_of_key(x): the number of elements that are strictly smaller
*/
#include<bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_real_distribution<> pp(0.0,1.0);
#define int long long
#define ld long double
#define pii pair<int,int>
#define piii pair<int,pii>
#define mpp make_pair
#define fi first
#define se second
const int inf=1e18;
const int mod=998244353;
const int maxn=505;
const int B=650;
const int maxs=655;
const int maxm=200005;
const int maxq=1000005;
const int maxl=25;
const int maxa=1000000;
const int root=3;
int power(int a,int n){
    int res=1;
    while(n){
        if(n&1) res=res*a%mod;
        a=a*a%mod;n>>=1;
    }
    return res;
}
const int iroot=power(3,mod-2);
const int base=101;

int w[maxn][maxn],d;

void solve(){
    int n;cin >> n;n--;
    for(int i=0;i<n;i++){
        w[i][n]=w[n][i]=++d;
        for(int j=1;j<=n/2;j++){
            int u=(i-j+n)%n,v=(i+j+n)%n;
            w[u][v]=w[v][u]=++d;
        }
    }
    for(int i=0;i<n;i++){
        for(int j=i+1;j<=n;j++) cout << w[i][j] << ' ';
        cout << '\n';
    }
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int test=1;//cin >> test;
    while(test--) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 10
Accepted
time: 0ms
memory: 3784kb

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: 0ms
memory: 3808kb

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 15...

result:

ok your answer is completely correct

Test #3:

score: 10
Accepted
time: 0ms
memory: 3964kb

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 ...

result:

ok your answer is completely correct

Test #4:

score: 10
Accepted
time: 1ms
memory: 4036kb

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: 1ms
memory: 4060kb

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: 1ms
memory: 4516kb

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: 0ms
memory: 4788kb

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: 0ms
memory: 5232kb

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: 6ms
memory: 5608kb

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: 6ms
memory: 5704kb

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