博客几种可选代码配色方案

autumn
#include<bits/stdc++.h>
using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int main() { int n,m,t; scanf("%d",&n); for (int i = 0;i < n;i++) scanf("%d",&p[i]); for (int i = 0;i < n;i++) scanf("%d",&a[i]); for (int i = 0;i < n;i++) scanf("%d",&b[i]); for (int i = 0;i < n;i++) { s[a[i]].insert(make_pair(p[i],i)); s[b[i]].insert(make_pair(p[i],i)); vis[i] = true; } scanf("%d",&m); while (m--) { int ans = -1; scanf("%d",&t); while (!s[t].empty()) { int pos = (*(s[t].begin())).second; s[t].erase(s[t].begin()); if (!vis[pos]) continue; ans = p[pos]; vis[pos] = false; break; } printf("%d ",ans); } puts(" "); return 0; }



emacs
#include<bits/stdc++.h>
using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int main() { int n,m,t; scanf("%d",&n); for (int i = 0;i < n;i++) scanf("%d",&p[i]); for (int i = 0;i < n;i++) scanf("%d",&a[i]); for (int i = 0;i < n;i++) scanf("%d",&b[i]); for (int i = 0;i < n;i++) { s[a[i]].insert(make_pair(p[i],i)); s[b[i]].insert(make_pair(p[i],i)); vis[i] = true; } scanf("%d",&m); while (m--) { int ans = -1; scanf("%d",&t); while (!s[t].empty()) { int pos = (*(s[t].begin())).second; s[t].erase(s[t].begin()); if (!vis[pos]) continue; ans = p[pos]; vis[pos] = false; break; } printf("%d ",ans); } puts(" "); return 0; }
 
 
colorful
#include<bits/stdc++.h>
using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int main() { int n,m,t; scanf("%d",&n); for (int i = 0;i < n;i++) scanf("%d",&p[i]); for (int i = 0;i < n;i++) scanf("%d",&a[i]); for (int i = 0;i < n;i++) scanf("%d",&b[i]); for (int i = 0;i < n;i++) { s[a[i]].insert(make_pair(p[i],i)); s[b[i]].insert(make_pair(p[i],i)); vis[i] = true; } scanf("%d",&m); while (m--) { int ans = -1; scanf("%d",&t); while (!s[t].empty()) { int pos = (*(s[t].begin())).second; s[t].erase(s[t].begin()); if (!vis[pos]) continue; ans = p[pos]; vis[pos] = false; break; } printf("%d ",ans); } puts(" "); return 0; }
 
 
perldoc
#include<bits/stdc++.h>
using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int main() { int n,m,t; scanf("%d",&n); for (int i = 0;i < n;i++) scanf("%d",&p[i]); for (int i = 0;i < n;i++) scanf("%d",&a[i]); for (int i = 0;i < n;i++) scanf("%d",&b[i]); for (int i = 0;i < n;i++) { s[a[i]].insert(make_pair(p[i],i)); s[b[i]].insert(make_pair(p[i],i)); vis[i] = true; } scanf("%d",&m); while (m--) { int ans = -1; scanf("%d",&t); while (!s[t].empty()) { int pos = (*(s[t].begin())).second; s[t].erase(s[t].begin()); if (!vis[pos]) continue; ans = p[pos]; vis[pos] = false; break; } printf("%d ",ans); } puts(" "); return 0; }
 
pastie
#include<bits/stdc++.h>
using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int main() { int n,m,t; scanf("%d",&n); for (int i = 0;i < n;i++) scanf("%d",&p[i]); for (int i = 0;i < n;i++) scanf("%d",&a[i]); for (int i = 0;i < n;i++) scanf("%d",&b[i]); for (int i = 0;i < n;i++) { s[a[i]].insert(make_pair(p[i],i)); s[b[i]].insert(make_pair(p[i],i)); vis[i] = true; } scanf("%d",&m); while (m--) { int ans = -1; scanf("%d",&t); while (!s[t].empty()) { int pos = (*(s[t].begin())).second; s[t].erase(s[t].begin()); if (!vis[pos]) continue; ans = p[pos]; vis[pos] = false; break; } printf("%d ",ans); } puts(" "); return 0; }
 
manni
#include<bits/stdc++.h>
using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int main() { int n,m,t; scanf("%d",&n); for (int i = 0;i < n;i++) scanf("%d",&p[i]); for (int i = 0;i < n;i++) scanf("%d",&a[i]); for (int i = 0;i < n;i++) scanf("%d",&b[i]); for (int i = 0;i < n;i++) { s[a[i]].insert(make_pair(p[i],i)); s[b[i]].insert(make_pair(p[i],i)); vis[i] = true; } scanf("%d",&m); while (m--) { int ans = -1; scanf("%d",&t); while (!s[t].empty()) { int pos = (*(s[t].begin())).second; s[t].erase(s[t].begin()); if (!vis[pos]) continue; ans = p[pos]; vis[pos] = false; break; } printf("%d ",ans); } puts(" "); return 0; }
 
Monokai
#include<bits/stdc++.h>
using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int main() { int n,m,t; scanf("%d",&n); for (int i = 0;i < n;i++) scanf("%d",&p[i]); for (int i = 0;i < n;i++) scanf("%d",&a[i]); for (int i = 0;i < n;i++) scanf("%d",&b[i]); for (int i = 0;i < n;i++) { s[a[i]].insert(make_pair(p[i],i)); s[b[i]].insert(make_pair(p[i],i)); vis[i] = true; } scanf("%d",&m); while (m--) { int ans = -1; scanf("%d",&t); while (!s[t].empty()) { int pos = (*(s[t].begin())).second; s[t].erase(s[t].begin()); if (!vis[pos]) continue; ans = p[pos]; vis[pos] = false; break; } printf("%d ",ans); } puts(" "); return 0; }
 
使用SyntaxHighlighter更改的配色
#include<bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int p[maxn],a[maxn],b[maxn];
bool vis[maxn];
set<pair<int,int> >s[5];

int main()
{
    int n,m,t;
    scanf("%d",&n);
    for (int i = 0;i < n;i++)    scanf("%d",&p[i]);
    for (int i = 0;i < n;i++)    scanf("%d",&a[i]);
    for (int i = 0;i < n;i++)    scanf("%d",&b[i]);
    for (int i = 0;i < n;i++)
    {
        s[a[i]].insert(make_pair(p[i],i));
        s[b[i]].insert(make_pair(p[i],i));
        vis[i] = true;
    }
    scanf("%d",&m);
    while (m--)
    {
        int ans = -1;
        scanf("%d",&t);
        while (!s[t].empty())
        {
            int pos = (*(s[t].begin())).second;
            s[t].erase(s[t].begin());
            if (!vis[pos])  continue;
            ans = p[pos];
            vis[pos] = false;
            break;
        }
        printf("%d ",ans);
    }
    puts(" ");
    return 0;
}

  

转载于:https://www.cnblogs.com/ZhaoxiCheung/p/6915846.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值