头像

刷题大师




离线:11小时前


最近来访(10)
用户头像
铜锣烧_5
用户头像
xorrr
用户头像
踩掉楼上的鞋
用户头像
白之月
用户头像
曹家硕
用户头像
Acwing-ly
用户头像
cheng_5
用户头像
听取AC声一片
用户头像
九天
用户头像
笑的心酸


刷题大师
11小时前
#include<bits/stdc++.h>
using namespace std;
int ts[1100]; 
int main(){
    int n, q;
    cin >> n >> q;
    for(int i = 1; i <= n; i ++) cin >> ts[i];
    sort(ts + 1, ts + n + 1);
    int Has = 0, l, xq;
    for(int i = 1; i <= q; i ++){
        cin >> l >> xq;
        Has = 0;
        l = pow(10, l);
        for(int j = 1; j <= n; j ++){
            if(ts[j] % l == xq){
                cout << ts[j] << endl;
                Has = 1;
                break;
            }
        }
        if(!Has) cout << "-1" << endl;
    } 
    return 0;
}



刷题大师
11小时前
#include<bits/stdc++.h>
using namespace std;
char s[20]; 
int main(){
    cin >> s;
    int qd = 0, len = strlen(s);
    if(s[0] == '-'){
        cout << '-';
        qd = 1;
    }
    bool canP = false;
    for(int i = len - 1; i >= qd; i --){
        if(s[i] != '0'){
            cout << s[i];
            canP = true;
        }else if(canP){
            cout << '0';
        }
    }
    return 0;
}



#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int a[N], n, m, i, j;
int main(){
    cin >> n;
    ios::sync_with_stdio(false);
    for(int i = 1; i <= n; i ++){
        cin >> a[i];
    }
    sort(a + 1, a + 1 + n);
    for(int i = 1; i <= n; i++){
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
    double a, b, c;
    cin >> a >> b >> c;
    cout << "TRIANGULO: " << fixed << setprecision(3) << a * c / 2 << endl;
    cout << "CIRCULO: " << fixed << setprecision(3) << c * c * 3.14159 << endl;
    cout << "TRAPEZIO: " << fixed << setprecision(3) << (a + b) * c / 2 << endl;
    cout << "QUADRADO: " << fixed << setprecision(3) << b * b << endl;
    cout << "RETANGULO: " << fixed << setprecision(3) << a * b << endl;
    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
    string n;
    double d, y, x;
    cin >> n >> d >> y;
    x = d + y * 0.15;
    cout << fixed << setprecision(2) << "TOTAL = R$ " << x << endl;
    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
    int n, a = 0, b = 1, c;
    cin >> n;
    if (n == 1) {
        cout << a << ' ';
        return 0;
    }
    cout << a << ' ' << b << ' ';
    for (int i = 2; i < n; ++i) {
        c = a + b;
        cout << c << ' ';
        a = b, b = c;
    }
    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << "DIFERENCA = " << a * b - c * d << endl;
    return 0;
}



#include<bits/stdc++.h>
using namespace std;
int main(){
    int a, b;
    cin >> a >> b;
    if(a % b == 0 || b % a == 0){
        cout << "Sao Multiplos" << endl;
    } else {
        cout << "Nao sao Multiplos" << endl;
    } 
    return 0;
}



```]

include[HTML_REMOVED]

using namespace std;
typedef long long ll;
bool isf(ll p, ll q) {
p = p % q;
int cnt = 0;
while(p != 0) {
p = p * 10 % q;
cnt ++;
if(cnt > 1000) return false;
}
return cnt <= 1000;
}
int main(){
int n;
cin >> n;
ll p, q;
while(n –) {
cin >> p >> q;
if(isf(p, q)) cout << “Finite” << endl;
else cout << “Infinite” << endl;
}
return 0;
}
```




#include<bits/stdc++.h>
using namespace std;
int main(){
    int t, s, x;
    cin >> t >> s >> x;
    t = x - t;
    if(t % s == 0 || t % s == 1 && t != 1){
        cout << "YES";
    } else {
        cout << "NO";
    }
    return 0;
}