Skip to content

Commit d82f627

Browse files
committed
Atcoder and Cf round done
1 parent 8dd4775 commit d82f627

11 files changed

+1789
-0
lines changed

Atcoder/ABC/abc212/abc212_A-Alloy.cpp

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/*
2+
written by Pankaj Kumar.
3+
country:-INDIA
4+
Institute: National Institute of Technology, Uttarakhand
5+
*/
6+
#include <bits/stdc++.h>
7+
#include <ext/pb_ds/assoc_container.hpp>
8+
#include <ext/pb_ds/tree_policy.hpp>
9+
using namespace std;
10+
using namespace __gnu_pbds;
11+
typedef long long ll ;
12+
typedef unsigned long long ull;
13+
typedef vector<ll> vl;
14+
typedef vector<vector<ll>> vvl;
15+
#define speed cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
16+
/* Abbrevations */
17+
#define ff first
18+
#define ss second
19+
#define mp make_pair
20+
#define line cout<<endl;
21+
#define pb push_back
22+
// loops
23+
#define forin(arr,n) for(ll i=0;i<n;i++) cin>>arr[i];
24+
// Some print
25+
#define no cout<<"NO"<<endl;
26+
#define yes cout<<"YES"<<endl;
27+
// sort
28+
#define all(V) (V).begin(),(V).end()
29+
#define srt(V) sort(all(V))
30+
#define srtGreat(V) sort(all(V),greater<ll>())
31+
// some extra
32+
#define printv(v) for(ll i=0;i<ll(v.size());i++){cout<<v[i]<<" ";} line;
33+
#define precision(x) cout<<fixed<<setprecision(x);
34+
#define sz(V) ll(V.size())
35+
// template
36+
template <typename T>
37+
T mymax(T x,T y)
38+
{
39+
return (x>y)?x:y;
40+
}
41+
42+
// datatype definination
43+
#define ordered_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
44+
45+
46+
class Codeforces
47+
{
48+
private:
49+
// read only variable
50+
const ll INF=1e18;
51+
const ll mod1=1e9+7;
52+
const ll mod2=998244353;
53+
54+
55+
public:
56+
Codeforces(){
57+
58+
}
59+
60+
ll power(ll x,ll y){
61+
ll result=1;
62+
while(y>0){
63+
if(y&1){
64+
result*=x;
65+
}
66+
y>>=1;
67+
x*=x;
68+
}
69+
return result;
70+
}
71+
72+
ll power(ll x,ll y,ll mod){
73+
ll result=1;
74+
x%=mod;
75+
while(y>0){
76+
if(y&1){
77+
result*=x;
78+
result%=mod;
79+
}
80+
y>>=1;
81+
x*=x;
82+
x%=mod;
83+
}
84+
return result;
85+
}
86+
87+
ll str_to_num(string s)
88+
{
89+
stringstream pk(s);
90+
ll num;
91+
pk>>num;
92+
return num;
93+
}
94+
95+
string num_to_str(ll num)
96+
{
97+
return to_string(num);
98+
}
99+
// Techniques :
100+
// divide into cases, brute force, pattern finding
101+
// sort, greedy, binary search, two pointer
102+
// transform into graph
103+
104+
// Experience :
105+
// Cp is nothing but only observation and mathematics.
106+
ll solve()
107+
{
108+
ll a,b;
109+
cin>>a>>b;
110+
if(a==0){
111+
cout<<"Silver"<<endl;
112+
}
113+
else if(b==0){
114+
cout<<"Gold"<<endl;
115+
}
116+
else{
117+
cout<<"Alloy"<<endl;
118+
}
119+
return 0;
120+
}
121+
};
122+
123+
124+
/* --------------------MAIN PROGRAM----------------------------*/
125+
126+
int main()
127+
{
128+
speed;
129+
/* #ifndef ONLINE_JUDGE
130+
freopen("input.txt","r",stdin);
131+
freopen("output.txt","w",stdout);
132+
#endif */
133+
ll TestCase=1;
134+
// cin>>TestCase;;
135+
while(TestCase--)
136+
{
137+
Codeforces cf;
138+
cf.solve();
139+
}
140+
}
141+
/* -----------------END OF PROGRAM --------------------*/
142+
/*
143+
* stuff you should look before submission
144+
* constraint and time limit
145+
* int overflow
146+
* special test case (n=0||n=1||n=2)
147+
* don't get stuck on one approach if you get wrong answer
148+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
/*
2+
written by Pankaj Kumar.
3+
country:-INDIA
4+
Institute: National Institute of Technology, Uttarakhand
5+
*/
6+
#include <bits/stdc++.h>
7+
#include <ext/pb_ds/assoc_container.hpp>
8+
#include <ext/pb_ds/tree_policy.hpp>
9+
using namespace std;
10+
using namespace __gnu_pbds;
11+
typedef long long ll ;
12+
typedef unsigned long long ull;
13+
typedef vector<ll> vl;
14+
typedef vector<vector<ll>> vvl;
15+
#define speed cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
16+
/* Abbrevations */
17+
#define ff first
18+
#define ss second
19+
#define mp make_pair
20+
#define line cout<<endl;
21+
#define pb push_back
22+
// loops
23+
#define forin(arr,n) for(ll i=0;i<n;i++) cin>>arr[i];
24+
// Some print
25+
#define no cout<<"NO"<<endl;
26+
#define yes cout<<"YES"<<endl;
27+
// sort
28+
#define all(V) (V).begin(),(V).end()
29+
#define srt(V) sort(all(V))
30+
#define srtGreat(V) sort(all(V),greater<ll>())
31+
// some extra
32+
#define printv(v) for(ll i=0;i<ll(v.size());i++){cout<<v[i]<<" ";} line;
33+
#define precision(x) cout<<fixed<<setprecision(x);
34+
#define sz(V) ll(V.size())
35+
// template
36+
template <typename T>
37+
T mymax(T x,T y)
38+
{
39+
return (x>y)?x:y;
40+
}
41+
42+
// datatype definination
43+
#define ordered_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
44+
45+
46+
class Codeforces
47+
{
48+
private:
49+
// read only variable
50+
const ll INF=1e18;
51+
const ll mod1=1e9+7;
52+
const ll mod2=998244353;
53+
54+
55+
public:
56+
Codeforces(){
57+
58+
}
59+
60+
ll power(ll x,ll y){
61+
ll result=1;
62+
while(y>0){
63+
if(y&1){
64+
result*=x;
65+
}
66+
y>>=1;
67+
x*=x;
68+
}
69+
return result;
70+
}
71+
72+
ll power(ll x,ll y,ll mod){
73+
ll result=1;
74+
x%=mod;
75+
while(y>0){
76+
if(y&1){
77+
result*=x;
78+
result%=mod;
79+
}
80+
y>>=1;
81+
x*=x;
82+
x%=mod;
83+
}
84+
return result;
85+
}
86+
87+
ll str_to_num(string s)
88+
{
89+
stringstream pk(s);
90+
ll num;
91+
pk>>num;
92+
return num;
93+
}
94+
95+
string num_to_str(ll num)
96+
{
97+
return to_string(num);
98+
}
99+
// Techniques :
100+
// divide into cases, brute force, pattern finding
101+
// sort, greedy, binary search, two pointer
102+
// transform into graph
103+
104+
// Experience :
105+
// Cp is nothing but only observation and mathematics.
106+
ll solve()
107+
{
108+
string s;
109+
cin>>s;
110+
ll flag=0;
111+
for(ll i=1;i<=3;i++){
112+
if(s[i]==s[0]){
113+
flag++;
114+
}
115+
}
116+
if(flag==3){
117+
cout<<"Weak"<<endl;
118+
return 0;
119+
}
120+
else if(flag<3){
121+
flag=0;
122+
for(ll i=0;i<3;i++){
123+
ll temp=ll(s[i]-'0');
124+
ll temp2=ll(s[i+1]-'0');
125+
temp=(temp+1)%10;
126+
if(temp==temp2){
127+
flag++;
128+
}
129+
}
130+
if(flag==3){
131+
cout<<"Weak"<<endl;
132+
return 0;
133+
}
134+
135+
}
136+
cout<<"Strong"<<endl;
137+
return 0;
138+
}
139+
};
140+
141+
142+
/* --------------------MAIN PROGRAM----------------------------*/
143+
144+
int main()
145+
{
146+
speed;
147+
/* #ifndef ONLINE_JUDGE
148+
freopen("input.txt","r",stdin);
149+
freopen("output.txt","w",stdout);
150+
#endif */
151+
ll TestCase=1;
152+
// cin>>TestCase;;
153+
while(TestCase--)
154+
{
155+
Codeforces cf;
156+
cf.solve();
157+
}
158+
}
159+
/* -----------------END OF PROGRAM --------------------*/
160+
/*
161+
* stuff you should look before submission
162+
* constraint and time limit
163+
* int overflow
164+
* special test case (n=0||n=1||n=2)
165+
* don't get stuck on one approach if you get wrong answer
166+
*/

0 commit comments

Comments
 (0)