Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <string>
- #include <stack>
- #include <set>
- #include <map>
- #define pii pair <int,int>
- using namespace std;
- using ll = long long;
- using ld = long double;
- void cv(vector <int> &v){
- for (auto x: v) cout<<x<<' ';
- cout<<"\n\n";
- }
- bool ch(int a, int b, int c){
- return a != b && b != c && a != c;
- }
- vector <int> v;
- //дуга
- bool inj(int p1, int p2, int p3){//p3 НЕ ледит между p1 и p2
- if (p1 > p2) swap(p1, p2);
- int id1, id2;
- id1 = p1 + 12 - p2;
- id2 = p2 - p1;
- int r;
- if (p1 < p3 && p3 < p2) r = id1 * 15;
- else if (p1 == 0 && p3 <= 11 && p3>p2) r = id2*15;
- else r = 15 * id2;
- return r < 90;
- }
- void sh(int p1, int p2, int p3){//p3 НЕ ледит между p1 и p2
- if (p1 > p2) swap(p1, p2);
- int id1, id2;
- id1 = p1 + 12 - p2;
- id2 = p2 - p1;
- int r;
- cout<<"id1 = "<<id1<<"\n";
- cout<<"id2= "<<id2<<"\n";
- if (p1 < p3 && p3 < p2) {
- cout<<"one\n";
- r = id1 * 15;
- }
- else if (p1 == 0 && p3 <= 11 && p3>p2){
- cout<<"two\n";
- r = id2*15;
- }
- else {cout<<"three\n";
- r = 15 * id2;
- }
- cout<<"r= "<<r<<"\n";
- //return r < 90;
- }
- int ug(int p1, int p2, int p3){//p3 НЕ ледит между p1 и p2
- if (p1 > p2) swap(p1, p2);
- int id1, id2;
- id1 = p1 + 12 - p2;
- id2 = p2 - p1;
- int r;
- if (p1 < p3 && p3 < p2) r = id1 * 15;
- else if (p1 == 0 && p3 <= 11 && p3>p2) r = id2*15;
- else r = 15 * id2;
- return r;
- }
- int main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- for (int i=0;i<4;++i){
- v.push_back(1);
- v.push_back(2);
- v.push_back(3);
- }
- //cv(v);
- int ans=0;
- for (int a = 0; a < 12; ++a){
- for (int b = 0; b < 12; ++b){
- for (int c=0;c<12;++c){
- if (ch(a,b,c) && ch(v[a], v[b], v[c])){
- if(inj(a,b,c) && inj(b,c,a) && inj(c,a,b)){
- ans++;
- //cout<<a<<' '<<b<<' '<<c<<" ug= "<<ug(a,b,c)<<'\n';
- }
- }
- }
- }
- }
- //cout<<ans<<'\n';
- sh(7, 9, 2);
- }
- //7 9 2
Add Comment
Please, Sign In to add comment