#include <iostream> using namespace std; int main() { int a; cin>>a; if (a>=7) cout<<"Yes"; if (a<7) cout<<"No"; return 0; } #include <stdio.h> int main(){ int a, b, c; scanf("%d", &a); b=12-a; if(b*45<=240){ printf("Yes"); } else{ printf("No"); } return 0; } #include<stdio.h> int main() {int f,left,time; scanf("%d",&f); left=12-f; time=left*45; if(time<=240){ printf("Yes");} else{printf("No"):} return 0;} else{printf("No"):} ; not : xd #include <stdio.h> #include <math.h> int main() { int n; scanf("%d",&n); n=12-n; n>=7?printf("NO"):printf("YES"); return 0; } #include <stdio.h> int main(){ int n1,h,g; scanf ("%d",&n1); h=12-n1; g=h*45; if (g<=300){ printf ("YES");} else{ printf("NO");} return 0; }
/*In the name of Almighty Allah*/ #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<string> vs; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int,int> pii; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> vll; typedef set<int> si; typedef map<string,int> msi; typedef double dl; typedef string st; #define PB push_back #define F first #define S second #define MP make_pair #define endl '\n' #define all(a) (a).begin(),(a).end() #define sz(x) (int)x.size() #define mid(l,r) ((r+l)/2) #define left(node) (node*2) #define right(node) (node*2+1) #define mx_int_prime 999999937 #define CY cout<<"YES"<<endl #define CN cout<<"NO"<<endl #define rn return 0 const double PI = acos(-1); const double eps = 1e-9;//10^-9 const int inf = 2000000000; const ll infLL = 9000000000000000000; #define MOD 1000000007 #define PI 2*acos(0.0) #define mem(a,b) memset(a, b, sizeof(a) ) #define gcd(a,b) __gcd(a,b) #define sqr(a) ((a) * (a)) #define sw(a,b) swap(a,b) #define sor(a) sort(a.begin(),a.end()) #define sorr(a) sort(a.begin(),a.end(),greater<int>()) #define uni(s) unique(s.begin(),s.end())-s.begin() #define mxdex(a) max_element(v.begin(),v.end())-v.begin() #define mindex(a) min_element(v.begin(),v.end())-v.begin() #define mxele(a) max_element(v.begin(),v.end()) #define minele(a) min_element(v.begin(),v.end()) #define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define fraction(a) cout.unsetf(ios::floatfield); cout.precision(a); cout.setf(ios::fixed,ios::floatfield); #define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout); typedef vector<int>::iterator vit; typedef set<int>::iterator sit; int dx[] = {0, 0, +1, -1}; int dy[] = {+1, -1, 0, 0}; //int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1}; //int dy[] = {0, +1, 0, -1, +1, -1, +1, -1}; //Debugger template < typename F, typename S > ostream& operator << ( ostream& os, const pair< F, S > & p ) { return os << "(" << p.first << ", " << p.second << ")"; } template < typename T > ostream &operator << ( ostream & os, const vector< T > &v ) { os << "{"; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << *it; } return os << "}"; } template < typename T > ostream &operator << ( ostream & os, const set< T > &v ) { os << "["; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << *it; } return os << "]"; } template < typename T > ostream &operator << ( ostream & os, const multiset< T > &v ) { os << "["; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << *it; } return os << "]"; } template < typename F, typename S > ostream &operator << ( ostream & os, const map< F, S > &v ) { os << "["; for(auto it = v.begin(); it != v.end(); ++it) { if( it != v.begin() ) os << ", "; os << it -> first << " = " << it -> second ; } return os << "]"; } #define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0) void faltu () { cerr << endl; } template <typename T> void faltu( T a[], int n ) { for(int i = 0; i < n; ++i) cerr << a[i] << ' '; cerr << endl; } template <typename T, typename ... hello> void faltu( T arg, const hello &... rest) { cerr << arg << ' '; faltu(rest...); } int main() { optimize(); int f; cin>>f; int x=240/(12-f); if(x<45) CN; else CY; rn; } Edited by author 17.01.2021 23:37 int f; cin >> f; int obs = 255; /* 5 hours = 300 minutes all time = 300 minutes - 45 minutes(for f tasks) */ int r = 12 - f; // tasks after first hour int ans = 45 * r; // time for solution if (ans <= obs) cout << "YES" << endl; else cout << "NO" << endl; Edited by author 15.05.2020 17:20 Edited by author 15.05.2020 17:20 if (5 + f >= 12) cout << "YES"; else cout << "NO"; cuz (60 * 4) // 45 = 5 he can solve 5 tasks in last 4 hours Edited by author 11.01.2021 13:20 Edited by author 11.01.2021 13:20 #include<bits/stdc++.h> using namespace std; int main(void) { int t_h,s_h,pb; while(cin>>pb) { s_h=0,t_h=0; if(pb>=1 && pb<=11) { s_h=12-pb; t_h=s_h*45; if(t_h<=240) cout<<"Yes"<<endl; else cout<<"No"<<endl; } } return 0; } #include <iostream> using namespace std; int main() { int n; cin>>n; if(1<=n&&n<=12) { int a=12-n; if(a*45<=4*60) cout<<"YES"; else cout<<"NO"; } return 0; } a=int(input()) tasks_left=12-a if tasks_left*45<=240: print('TRUE') else: print('FALSE') Because you should output "YES" /"NO" , not "TRUE" /"FALSE" Edited by author 21.07.2017 10:33 but it doesnt work. a=int(input('input solved task:')) tasks_left=12-a if tasks_left*45<=240: print('YES') else: print('NO') Thanks. Now it's work. i've changed from a=int(input('input solved task:')) to a=int(input()) import java.util.Scanner; public class T2012 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int f=sc.nextInt(); int r=12-f; int time=r*45; if(time<=240) System.out.println("YES"); else System.out.println("NO"); } } for python a=int(input()) question=12 time=240 tasks_left=question-a if tasks_left*45<=240: print('true') else: print('false') hey guys,this is my solution.Hope you like it :) C++. #include <bits/stdc++.h> using namespace std; queue<int>qu; //queue #define pii pair<int,int> //pair #define maxx 500 //maximum of anything vector<pii>vpii[maxx]; //Vector of pair #define inf 0x7fffffff //INFINITY int X[]={+2,+2,-2,-2,+1,-1,-1,+1}; //knight movement left/right int Y[]={-1,+1,-1,+1,+2,+2,-2,-2};//knight movement up/down int main() { int pr; while(cin>>pr){ int r=max(0,12-pr); int minutes=(4*60)-r*45; cout<<(minutes>=0?"YES\n":"NO\n"); } return 0; } Edited by author 03.06.2015 10:10 Edited by author 03.06.2015 10:10 in my country we use the following sentence for your kind of code :"turning food around head then eating it" i mean you are just overkilling such an easy question but i learnt a little trick from your code thanks for that #include <iostream> using namespace std; int main() { int n; cin>>n; if(1<=n&&n<=11) { int a=12-n; if(a*3/4<=4) cout<<"YES"; else cout<<"NO"; } return 0; } Or should we have our program do all calculations? |
|