Submission #70488378
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------
int T,N;
int A[2025];
void solve() {
int i,j,k,l,r,x,y; string s;
cin>>T;
while(T--) {
cin>>N;
vector<int> V;
int sum=0;
FOR(i,12) {
x=min(1<<i,N-sum);
if(x) {
FOR(j,x) {
A[sum+j]=(1<<(i+15))+(1<<(12-i))+j;
}
V.push_back(x);
}
sum+=x;
}
FOR(i,N) cout<<A[i]<<" ";
cout<<endl;
FOR(i,N) {
int p=0;
int lef=i+1;
for(j=V.size()-1;j>=0;j--) {
if(V[j]-1>=lef) {
lef-=V[j]-1;
}
else {
p|=(1<<(j+15));
}
}
cout<<p<<" ";
}
cout<<endl;
}
}
int main(int argc,char** argv){
string s;int i;
if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
cout.tie(0); solve(); return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - PORALIS |
| User | kmjp |
| Language | C++ 20 (gcc 12.2) |
| Score | 0 |
| Code Size | 1411 Byte |
| Status | WA |
| Exec Time | 393 ms |
| Memory | 3612 KiB |
Compile Error
Main.cpp: In function ‘void solve()’:
Main.cpp:20:17: warning: unused variable ‘k’ [-Wunused-variable]
20 | int i,j,k,l,r,x,y; string s;
| ^
Main.cpp:20:19: warning: unused variable ‘l’ [-Wunused-variable]
20 | int i,j,k,l,r,x,y; string s;
| ^
Main.cpp:20:21: warning: unused variable ‘r’ [-Wunused-variable]
20 | int i,j,k,l,r,x,y; string s;
| ^
Main.cpp:20:25: warning: unused variable ‘y’ [-Wunused-variable]
20 | int i,j,k,l,r,x,y; string s;
| ^
Main.cpp: In function ‘int main(int, char**)’:
Main.cpp:6:19: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
6 | #define FOR(x,to) for(x=0;x<(to);x++)
| ^~~
Main.cpp:66:9: note: in expansion of macro ‘FOR’
66 | FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
| ^~~
Main.cpp:6:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
6 | #define FOR(x,to) for(x=0;x<(to);x++)
| ^~~
Main.cpp:66:45: note: in expansion of macro ‘FOR’
66 | FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
| ^~~
Main.cpp:6:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
6 | #define FOR(x,to) for(x=0;x<(to);x++)
| ^
Main.cpp:66:45: note: in expansion of macro ‘FOR’
66 | FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
| ^~~
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 900 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-0.txt |
| All | 00-sample-0.txt, 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt, 01-24.txt, 01-25.txt, 01-26.txt, 01-27.txt, 01-28.txt, 01-29.txt, 01-30.txt, 01-31.txt, 01-32.txt, 01-33.txt, 01-34.txt, 01-35.txt, 01-36.txt, 01-37.txt, 01-38.txt, 01-39.txt, 01-40.txt, 01-41.txt, 01-42.txt, 01-43.txt, 01-44.txt, 01-45.txt, 01-46.txt, 01-47.txt, 01-48.txt, 01-49.txt, 01-50.txt, 01-51.txt, 01-52.txt, 01-53.txt, 01-54.txt, 01-55.txt, 01-56.txt, 01-57.txt, 01-58.txt, 01-59.txt, 01-60.txt, 01-61.txt, 01-62.txt, 01-63.txt, 01-64.txt, 01-65.txt, 01-66.txt, 01-67.txt, 01-68.txt, 01-69.txt, 01-70.txt, 01-71.txt, 01-72.txt, 01-73.txt, 01-74.txt, 01-75.txt, 01-76.txt, 01-77.txt, 01-78.txt, 01-79.txt, 01-80.txt, 01-81.txt, 01-82.txt, 01-83.txt, 02-0.txt, 03-0.txt, 03-1.txt, 03-2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-0.txt | WA | 1 ms | 3356 KiB |
| 01-00.txt | WA | 1 ms | 3540 KiB |
| 01-01.txt | WA | 1 ms | 3480 KiB |
| 01-02.txt | WA | 1 ms | 3476 KiB |
| 01-03.txt | WA | 1 ms | 3552 KiB |
| 01-04.txt | WA | 1 ms | 3476 KiB |
| 01-05.txt | WA | 1 ms | 3344 KiB |
| 01-06.txt | WA | 1 ms | 3484 KiB |
| 01-07.txt | WA | 1 ms | 3420 KiB |
| 01-08.txt | WA | 1 ms | 3484 KiB |
| 01-09.txt | WA | 1 ms | 3412 KiB |
| 01-10.txt | WA | 1 ms | 3352 KiB |
| 01-11.txt | WA | 1 ms | 3480 KiB |
| 01-12.txt | WA | 1 ms | 3488 KiB |
| 01-13.txt | WA | 1 ms | 3556 KiB |
| 01-14.txt | WA | 1 ms | 3564 KiB |
| 01-15.txt | WA | 1 ms | 3420 KiB |
| 01-16.txt | WA | 1 ms | 3432 KiB |
| 01-17.txt | WA | 1 ms | 3428 KiB |
| 01-18.txt | WA | 1 ms | 3480 KiB |
| 01-19.txt | WA | 1 ms | 3480 KiB |
| 01-20.txt | WA | 1 ms | 3424 KiB |
| 01-21.txt | WA | 1 ms | 3476 KiB |
| 01-22.txt | WA | 1 ms | 3412 KiB |
| 01-23.txt | WA | 1 ms | 3484 KiB |
| 01-24.txt | WA | 1 ms | 3432 KiB |
| 01-25.txt | WA | 1 ms | 3432 KiB |
| 01-26.txt | WA | 1 ms | 3480 KiB |
| 01-27.txt | WA | 1 ms | 3484 KiB |
| 01-28.txt | WA | 1 ms | 3484 KiB |
| 01-29.txt | WA | 1 ms | 3412 KiB |
| 01-30.txt | WA | 1 ms | 3484 KiB |
| 01-31.txt | WA | 1 ms | 3428 KiB |
| 01-32.txt | WA | 1 ms | 3500 KiB |
| 01-33.txt | WA | 1 ms | 3476 KiB |
| 01-34.txt | WA | 1 ms | 3476 KiB |
| 01-35.txt | WA | 1 ms | 3408 KiB |
| 01-36.txt | WA | 1 ms | 3476 KiB |
| 01-37.txt | WA | 1 ms | 3496 KiB |
| 01-38.txt | WA | 1 ms | 3480 KiB |
| 01-39.txt | WA | 1 ms | 3472 KiB |
| 01-40.txt | WA | 1 ms | 3408 KiB |
| 01-41.txt | WA | 1 ms | 3424 KiB |
| 01-42.txt | WA | 1 ms | 3560 KiB |
| 01-43.txt | WA | 1 ms | 3476 KiB |
| 01-44.txt | WA | 1 ms | 3348 KiB |
| 01-45.txt | WA | 1 ms | 3484 KiB |
| 01-46.txt | WA | 1 ms | 3472 KiB |
| 01-47.txt | WA | 1 ms | 3420 KiB |
| 01-48.txt | WA | 1 ms | 3480 KiB |
| 01-49.txt | WA | 1 ms | 3476 KiB |
| 01-50.txt | WA | 1 ms | 3428 KiB |
| 01-51.txt | WA | 1 ms | 3432 KiB |
| 01-52.txt | WA | 1 ms | 3488 KiB |
| 01-53.txt | WA | 1 ms | 3428 KiB |
| 01-54.txt | WA | 1 ms | 3484 KiB |
| 01-55.txt | WA | 1 ms | 3496 KiB |
| 01-56.txt | WA | 1 ms | 3472 KiB |
| 01-57.txt | WA | 1 ms | 3480 KiB |
| 01-58.txt | WA | 1 ms | 3548 KiB |
| 01-59.txt | WA | 1 ms | 3356 KiB |
| 01-60.txt | WA | 1 ms | 3484 KiB |
| 01-61.txt | WA | 1 ms | 3408 KiB |
| 01-62.txt | WA | 1 ms | 3432 KiB |
| 01-63.txt | WA | 1 ms | 3424 KiB |
| 01-64.txt | WA | 1 ms | 3488 KiB |
| 01-65.txt | WA | 1 ms | 3428 KiB |
| 01-66.txt | WA | 1 ms | 3480 KiB |
| 01-67.txt | WA | 1 ms | 3476 KiB |
| 01-68.txt | WA | 1 ms | 3432 KiB |
| 01-69.txt | WA | 1 ms | 3476 KiB |
| 01-70.txt | WA | 1 ms | 3480 KiB |
| 01-71.txt | WA | 1 ms | 3496 KiB |
| 01-72.txt | WA | 1 ms | 3428 KiB |
| 01-73.txt | WA | 1 ms | 3476 KiB |
| 01-74.txt | WA | 1 ms | 3612 KiB |
| 01-75.txt | WA | 1 ms | 3432 KiB |
| 01-76.txt | WA | 1 ms | 3500 KiB |
| 01-77.txt | WA | 1 ms | 3416 KiB |
| 01-78.txt | WA | 1 ms | 3428 KiB |
| 01-79.txt | WA | 1 ms | 3500 KiB |
| 01-80.txt | WA | 1 ms | 3468 KiB |
| 01-81.txt | WA | 1 ms | 3484 KiB |
| 01-82.txt | WA | 1 ms | 3608 KiB |
| 01-83.txt | WA | 1 ms | 3344 KiB |
| 02-0.txt | WA | 2 ms | 3428 KiB |
| 03-0.txt | AC | 393 ms | 3432 KiB |
| 03-1.txt | WA | 120 ms | 3556 KiB |
| 03-2.txt | WA | 102 ms | 3428 KiB |