首页 > 其他分享 >The 16th Zhejiang Provincial (小白 重现之我是Joker)

The 16th Zhejiang Provincial (小白 重现之我是Joker)

时间:2024-04-08 18:56:57浏览次数:27  
标签:Provincial cout namespace Joker Zhejiang solve include

G - Lucky 7 in the Pocket(签到题)

思路:

大于等于n,且被7整除,不能被4整除,算出这个数。

Code:

#include<bits/stdc++.h>
    
using namespace std;
    
void solve() {
    int n; cin >> n;
    for ( ; n ; ) {
        if (n % 7 == 0 && n % 4 != 0) {
            cout << n << '\n';
            return ;
        }
        n ++;
    }
    return ;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int T; cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}

F - Abbreviation (签到题)

思路:

去除a e i y o u, 但是不包括首字母 比如aa 输出第二个a.

Code:

#include<bits/stdc++.h>
    
using namespace std;
    
string a = "aeiyou";

void solve() {
    string s; cin >> s;
    cout << s[0];
    for (int i = 1; i < s.size(); i++) {
        bool ok = 1;
        for (char x : a) {
            if (x == s[i]) {
                ok = 0;
            }
        }
        if (ok) cout << s[i];
    }
    cout << '\n';
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int T; cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}

  

标签:Provincial,cout,namespace,Joker,Zhejiang,solve,include
From: https://www.cnblogs.com/youhualiuh/p/18122303

相关文章

  • The 19th Zhejiang Provincial Collegiate Programming Contest
    目录写在前面CBALMGIFJ写在最后写在前面比赛地址:https://codeforces.com/gym/103687。以下按照个人向难度排序JustaWay闪击珞珈之初次合作。理应能7题,但是赛时开局罚烂中期烂了两题导致后面的没法写被迫五题下班妈的唉牢鱼想你了C纯签到,建议评级:200///*By:Luckybl......
  • The 14th Jilin Provincial Collegiate Programming Contest
    The14thJilinProvincialCollegiateProgrammingContest-Codeforces队友太猛了,我整场就只写了D,其他题给队友开完了,预计补一下M,FProblemD.Trie(AC自动机+树状数组)大概就是给定一颗Trie树操作一是给Trie树的fail树上一个集合中的点的所有子节点打上一个......
  • JB Loves Math(The 19th Zhejiang Provincial Collegiate Programming Contest)
    #include<bits/stdc++.h>#defineendl'\n'usingll=longlong;typedefunsignedlonglongull;usingnamespacestd;voidGordenGhost();signedmain(){#ifdefGordenfreopen("in.txt","rt",stdin);freopen......
  • JB Wants to Earn Big Money(The 19th Zhejiang Provincial Collegiate Programming Co
    #include<bits/stdc++.h>#defineendl'\n'usingll=longlong;typedefunsignedlonglongull;usingnamespacestd;voidGordenGhost();signedmain(){#ifdefGordenfreopen("in.txt","rt",stdin);freopen......
  • JB Loves Comma(The 19th Zhejiang Provincial Collegiate Programming Contest)
    #include<bits/stdc++.h>#defineendl'\n'usingll=longlong;typedefunsignedlonglongull;usingnamespacestd;voidGordenGhost();signedmain(){#ifdefGordenfreopen("in.txt","rt",stdin);freopen......
  • The 18th Heilongjiang Provincial Collegiate Programming Contest
    A.MagicComputer看题目猜规律#include<bits/stdc++.h>usingnamespacestd;#defineintlonglongusingvi=vector<int>;usingi32=int32_t;constintmod=998244353;intpower(intx,inty){intans=1;while(y){if(y&......
  • The 2021 Sichuan Provincial Collegiate Programming Contest
    题目链接:The2021SichuanProvincialCollegiateProgrammingContestA.Chuanpai题意:定义每一张川牌包含两个数字x,y,并且1<=x<= y<=6,求牌面上数字之和为n的牌种类解题思路:签到,预处理枚举即可查看代码map<int,int>mp;voidinit(){ for(inti=1;i<=6;i......
  • 浙江科技大学(Zhejiang University of Science and Technology)
    浙江科技大学(ZhejiangUniversityofScienceandTechnology)为浙江省属全日制本科高校,是一所具有硕士、学士学位授予权和外国留学生、港澳台学生招生权的特色鲜明的应用型省属本科高校,主校区位于杭州西湖区小和山高教园区,分校区位于安吉教科文新区,是教育部首批“卓越工程师教育培......
  • Joker+Joker=Rocket
    今天THUPC让我们队丑完了。开局把M签了,然后H写了个以为2log的3log做法,随机数据12s,开始玉玉症。接着开E发现是乱贪然后WAWAWA,继续玉玉症。wc说C是期望,那我不会啊,然后看了一眼tx在开的K,发现个数在\(1,2,3\)时答案分别是Away,Far,Away。然后玩了一下......
  • 2023 CCPC Henan Provincial Collegiate Programming Contest
    Preface徐神在训练前宣称要复习计通网,结果最后还是相当于全程参与了我们的训练这场我纯纯战犯表现,Easy题E狂挂7发最后发现原来是多测没清空干净,直接红温占用中期1h机时但好在祁神稳切了一手压轴计算几何,同时最后2h把卡着的题都过完了,最后又靠着题数捧杯(唉还在打弱省省赛找自信)......