답안 #958765

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
958765 2024-04-06T14:45:20 Z djs100201 자동 인형 (IOI18_doll) C++17
2 / 100
32 ms 10800 KB
#include<bits/stdc++.h>
#include "doll.h"
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using PP = pair<ll, P>;
const ll n_ =2e5+100, inf = (ll)2e9 * (ll)1e9 + 7, mod = 1e9+7;
ll n, m, tc = 1, a, b, c, d, sum, x, y, z, base, ans, k;
ll gcd(ll x,ll y){
	if(!y)return x;
	return gcd(y,x%y);
}
vector<int>v[n_];
void create_circuit(int M, vector<int> A) {

	int N = A.size();
	vector<int> C(M + 1),deg(M+1);
    C[0]=A[0];
	std::vector<int> X,Y;
    ll base;
    for(int i=0;i+1<N;i++)v[A[i]].push_back(A[i+1]);
    v[A[N-1]].push_back(0);
    for(int i=1;i<=M;i++){
        if(v[i].size()==0)C[i]=0;
        else if(v[i].size()==1)C[i]=v[i][0];
        else {
            C[i]=X.size();
            X.push_back(v[i][0]);
            Y.push_back(v[i][1]);
        }
    }
	answer(C, X, Y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:25:8: warning: unused variable 'base' [-Wunused-variable]
   25 |     ll base;
      |        ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 20 ms 9052 KB Output is correct
3 Correct 15 ms 8536 KB Output is correct
4 Correct 3 ms 4956 KB Output is correct
5 Correct 8 ms 6492 KB Output is correct
6 Correct 24 ms 10588 KB Output is correct
7 Correct 1 ms 4952 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 20 ms 9052 KB Output is correct
3 Correct 15 ms 8536 KB Output is correct
4 Correct 3 ms 4956 KB Output is correct
5 Correct 8 ms 6492 KB Output is correct
6 Correct 24 ms 10588 KB Output is correct
7 Correct 1 ms 4952 KB Output is correct
8 Incorrect 32 ms 10800 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4952 KB Output is correct
2 Correct 20 ms 9052 KB Output is correct
3 Correct 15 ms 8536 KB Output is correct
4 Correct 3 ms 4956 KB Output is correct
5 Correct 8 ms 6492 KB Output is correct
6 Correct 24 ms 10588 KB Output is correct
7 Correct 1 ms 4952 KB Output is correct
8 Incorrect 32 ms 10800 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4952 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4956 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4956 KB wrong motion
2 Halted 0 ms 0 KB -