답안 #1082733

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1082733 2024-09-01T10:32:57 Z dong_gas 마술쇼 (APIO24_show) C++17
35 / 100
1000 ms 1072 KB
#include <bits/extc++.h>
#include "Alice.h"
//#include "Bob.h"
#define all(v) v.begin(), v.end()
#define zip(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
using namespace __gnu_pbds;
template<class T> using PBDS = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T> using multiPBDS = tree<T, null_type,  less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

vector<pint> Alice(){
    ll x = setN(5000);
    vector<pint> edges;
    for(int i=2;i<=5000;i++) edges.push_back({x%(i-1)+1,i});
    return edges;
}
#include <bits/extc++.h>
//#include "Alice.h"
#include "Bob.h"
#define all(v) v.begin(), v.end()
#define zip(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
using namespace __gnu_pbds;
template<class T> using PBDS = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T> using multiPBDS = tree<T, null_type,  less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;


ll Bob(vector<pint> edges){
    ll ans=0, lc=1;
	for(auto& [u, v]:edges) {
        //v-1로 나눈 나머지가 u-1..
        u--, v--;
        while(ans%v!=u) ans+=lc;
        lc=lc*v/__gcd(lc,(ll)v);
	}
	return ans; 
}

# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 820 KB Correct.
2 Correct 1 ms 820 KB Correct.
3 Correct 1 ms 832 KB Correct.
4 Correct 1 ms 820 KB Correct.
5 Correct 2 ms 812 KB Correct.
6 Correct 2 ms 820 KB Correct.
7 Correct 2 ms 820 KB Correct.
8 Correct 2 ms 820 KB Correct.
9 Correct 2 ms 820 KB Correct.
10 Correct 2 ms 824 KB Correct.
11 Correct 2 ms 820 KB Correct.
12 Correct 2 ms 820 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 820 KB Correct.
2 Correct 1 ms 820 KB Correct.
3 Correct 1 ms 832 KB Correct.
4 Correct 1 ms 820 KB Correct.
5 Correct 2 ms 812 KB Correct.
6 Correct 2 ms 820 KB Correct.
7 Correct 2 ms 820 KB Correct.
8 Correct 2 ms 820 KB Correct.
9 Correct 2 ms 820 KB Correct.
10 Correct 2 ms 824 KB Correct.
11 Correct 2 ms 820 KB Correct.
12 Correct 2 ms 820 KB Correct.
13 Correct 2 ms 832 KB Correct.
14 Correct 2 ms 820 KB Correct.
15 Correct 2 ms 820 KB Correct.
16 Correct 2 ms 836 KB Correct.
17 Correct 1 ms 820 KB Correct.
18 Correct 2 ms 820 KB Correct.
19 Correct 2 ms 820 KB Correct.
20 Correct 1 ms 820 KB Correct.
21 Correct 2 ms 824 KB Correct.
22 Correct 2 ms 824 KB Correct.
23 Correct 2 ms 824 KB Correct.
24 Correct 1 ms 820 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 820 KB Correct.
2 Correct 1 ms 820 KB Correct.
3 Correct 1 ms 832 KB Correct.
4 Correct 1 ms 820 KB Correct.
5 Correct 2 ms 812 KB Correct.
6 Correct 2 ms 820 KB Correct.
7 Correct 2 ms 820 KB Correct.
8 Correct 2 ms 820 KB Correct.
9 Correct 2 ms 820 KB Correct.
10 Correct 2 ms 824 KB Correct.
11 Correct 2 ms 820 KB Correct.
12 Correct 2 ms 820 KB Correct.
13 Correct 2 ms 832 KB Correct.
14 Correct 2 ms 820 KB Correct.
15 Correct 2 ms 820 KB Correct.
16 Correct 2 ms 836 KB Correct.
17 Correct 1 ms 820 KB Correct.
18 Correct 2 ms 820 KB Correct.
19 Correct 2 ms 820 KB Correct.
20 Correct 1 ms 820 KB Correct.
21 Correct 2 ms 824 KB Correct.
22 Correct 2 ms 824 KB Correct.
23 Correct 2 ms 824 KB Correct.
24 Correct 1 ms 820 KB Correct.
25 Correct 2 ms 820 KB Correct.
26 Correct 2 ms 820 KB Correct.
27 Correct 2 ms 1072 KB Correct.
28 Execution timed out 1099 ms 820 KB Time limit exceeded
29 Halted 0 ms 0 KB -