Submission #56006077
Source Code Expand
Copy
// # NEVER GIVE UP#include <bits/stdc++.h>using namespace std;#include <ext/pb_ds/assoc_container.hpp>#include <ext/pb_ds/tree_policy.hpp>using namespace __gnu_pbds;template <typename T>using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//find_by_order(element) finds element at index(based on 0-index)//order_of_key(element) gives no of elements less than elementtypedef pair<long long int,long long int> pii;typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;//om.insert({a[i],om.size()}); om.order_of_key({k,-1}); check codeforces blog based on ordered_multiset//s.lower_bound(x) is faster than lower_bound(all(s),x)//function <output data type(input data types with commas)>f = [&](data types with variable names){body};//0000111 use u>l and m=(u+l)/2 and l=m+1 and u=m;cout<<u;//1111000 use u>l and m=(u+l+1)/2 and l=m ans u=m-1;cout<<l;#define ll long long int#define ull unsigned long long int#define endl "\n"#define fr(i, m, n) for (ll i = m; i < n; i++)
// # NEVER GIVE UP #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; //find_by_order(element) finds element at index(based on 0-index) //order_of_key(element) gives no of elements less than element typedef pair<long long int,long long int> pii; typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset; //om.insert({a[i],om.size()}); om.order_of_key({k,-1}); check codeforces blog based on ordered_multiset //s.lower_bound(x) is faster than lower_bound(all(s),x) //function <output data type(input data types with commas)>f = [&](data types with variable names){body}; //0000111 use u>l and m=(u+l)/2 and l=m+1 and u=m;cout<<u; //1111000 use u>l and m=(u+l+1)/2 and l=m ans u=m-1;cout<<l; #define ll long long int #define ull unsigned long long int #define endl "\n" #define fr(i, m, n) for (ll i = m; i < n; i++) #define rfr(i,m, n) for(ll i = m; i > n-1;i--) #define cnl cout<<endl #define r0 return 0 #define all(v) v.begin(),v.end() #define yy cout<<"Yes"<<endl #define nn cout<<"No"<<endl #define ff first #define ss second #define vll vector<ll> #define pb push_back #define dbg(a) cerr<< #a << "=" << (a)<<"\n"; const ll INF=1e18; const ll mod=1000000007; ll divandfloor(ll x, ll y) { assert(y!= 0); if((x>=0 and y>0) or (x<=0 and y<0))return x/y; return (1-abs(x))/abs(y)-1; } ll divandceil(ll x, ll y) { assert(y!=0); if((x>=0 and y<0) or (x<=0 and y>0))return x/y; return (abs(x)-1)/abs(y)+1; } int solve(){ int n;cin>>n; int sa=0,sw=0; for(int i=0;i<n;i++){ string s;cin>>s; if(s=="sweet") sa++; else sa=0; if(sa==2 and i+1==n){yy;r0;} else if(sa==2){nn;r0;} } yy; return 0; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll t=1; //cin>>t; // cout<<fixed<<setprecision(12); while(t--){ solve(); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Glutton Takahashi |
User | SadArtira |
Language | C++ 20 (gcc 12.2) |
Score | 100 |
Code Size | 2502 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3612 KB |
Compile Error
Main.cpp: In function ‘int solve()’: Main.cpp:49:18: warning: unused variable ‘sw’ [-Wunused-variable] 49 | int sa=0,sw=0; | ^~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt, sample02.txt |
All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3472 KB |
sample01.txt | AC | 1 ms | 3600 KB |
sample02.txt | AC | 1 ms | 3612 KB |
testcase00.txt | AC | 1 ms | 3448 KB |
testcase01.txt | AC | 1 ms | 3424 KB |
testcase02.txt | AC | 1 ms | 3380 KB |
testcase03.txt | AC | 1 ms | 3412 KB |
testcase04.txt | AC | 1 ms | 3408 KB |
testcase05.txt | AC | 1 ms | 3468 KB |
testcase06.txt | AC | 1 ms | 3384 KB |
testcase07.txt | AC | 1 ms | 3488 KB |
testcase08.txt | AC | 1 ms | 3516 KB |
testcase09.txt | AC | 1 ms | 3328 KB |
testcase10.txt | AC | 1 ms | 3464 KB |
testcase11.txt | AC | 1 ms | 3440 KB |
testcase12.txt | AC | 1 ms | 3384 KB |
testcase13.txt | AC | 1 ms | 3436 KB |
testcase14.txt | AC | 1 ms | 3424 KB |
testcase15.txt | AC | 1 ms | 3328 KB |