# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1112432 | 2024-11-14T07:46:12 Z | thelegendary08 | 자동 인형 (IOI18_doll) | C++14 | 1000 ms | 8940 KB |
#include "doll.h" #include<bits/stdc++.h> #define vi vector<int> #define pb push_back #define vvi vector<vector<int>> #define f0r(i,n) for(int i = 0; i<n; i++) using namespace std; void create_circuit(int M, std::vector<int> A) { if(M == 1){ vi v; v.pb(0); for(auto u : A)v.pb(u); v.pb(0); int n = v.size() - 2; int mx = ceil(log2(n)); int bts = (1 << mx) - n; int num = -1; vi x; vi y; vi c(M + 1); c[0] = 1; c[1] = -1; f0r(i, mx){ f0r(j, (1 << i)){ if(i != mx - 1){ x.pb(num * 2); y.pb(num * 2 - 1); } else{ x.pb(1); y.pb(1); } num--; } } //cout<<bts<<'\n'; for(int i = (1 << (mx - 1)); i < (1 << mx) - 1; i++){ if(bts >= 2){ x[i - 1] = -1; y[i-1] = -1; bts -= 2; } else if(bts == 1){ x[i-1] = -1; bts--; } } y[y.size() - 1] = 0; //vout(c); //vout(x); //vout(y); answer(c,x,y); } else{ vi v; v.pb(0); for(auto u : A)v.pb(u); v.pb(0); vvi nxt(M+1); f0r(i, v.size() - 1){ nxt[v[i]].pb(v[i+1]); } int num = -1; vi c(M+1); vi x; vi y; f0r(i, M+1){ if(nxt[i].size() == 1){ c[i] = nxt[i][0]; } else if(nxt[i].size() == 2){ c[i] = num; x.pb(nxt[i][0]); y.pb(nxt[i][1]); num--; } else if(nxt[i].size() == 3){ c[i] = num; x.pb(num-1); y.pb(num - 2); num--; x.pb(nxt[i][0]); y.pb(nxt[i][1]); num--; x.pb(c[i]); y.pb(nxt[i][2]); num--; } else if(nxt[i].size() == 4){ c[i] = num; x.pb(num-1); y.pb(num - 2); num--; x.pb(nxt[i][0]); y.pb(nxt[i][2]); num--; x.pb(nxt[i][1]); y.pb(nxt[i][3]); num--; } } answer(c,x,y); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 336 KB | Output is correct |
2 | Correct | 18 ms | 6640 KB | Output is correct |
3 | Correct | 16 ms | 5576 KB | Output is correct |
4 | Correct | 1 ms | 508 KB | Output is correct |
5 | Correct | 7 ms | 3920 KB | Output is correct |
6 | Correct | 23 ms | 8136 KB | Output is correct |
7 | Execution timed out | 1073 ms | 336 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 336 KB | Output is correct |
2 | Correct | 18 ms | 6640 KB | Output is correct |
3 | Correct | 16 ms | 5576 KB | Output is correct |
4 | Correct | 1 ms | 508 KB | Output is correct |
5 | Correct | 7 ms | 3920 KB | Output is correct |
6 | Correct | 23 ms | 8136 KB | Output is correct |
7 | Execution timed out | 1073 ms | 336 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 336 KB | Output is correct |
2 | Correct | 18 ms | 6640 KB | Output is correct |
3 | Correct | 16 ms | 5576 KB | Output is correct |
4 | Correct | 1 ms | 508 KB | Output is correct |
5 | Correct | 7 ms | 3920 KB | Output is correct |
6 | Correct | 23 ms | 8136 KB | Output is correct |
7 | Execution timed out | 1073 ms | 336 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 336 KB | Output is partially correct |
2 | Correct | 24 ms | 5484 KB | Output is correct |
3 | Partially correct | 42 ms | 8176 KB | Output is partially correct |
4 | Partially correct | 54 ms | 8940 KB | Output is partially correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 336 KB | Output is partially correct |
2 | Correct | 24 ms | 5484 KB | Output is correct |
3 | Partially correct | 42 ms | 8176 KB | Output is partially correct |
4 | Partially correct | 54 ms | 8940 KB | Output is partially correct |
5 | Incorrect | 32 ms | 6340 KB | wrong motion |
6 | Halted | 0 ms | 0 KB | - |