답안 #1055053

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1055053 2024-08-12T14:13:54 Z cpdreamer Crossing (JOI21_crossing) C++14
0 / 100
238 ms 848 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <utility>
#define V vector
#define P pair
#define S second
#define F first
#define pb push_back
#define all(v) v.begin(),v.end()
typedef long long ll;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,
        tree_order_statistics_node_update> indexed_set;
static int called = 0;const long long MOD = 1e9+7; // 1e9 + 7

void file(){
    freopen("input.txt.txt","r",stdin);
    freopen("output.txt.txt","w",stdout);
}
void file(string s) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
}
bool check(string s,string t){
    for(int i=0;i<s.size();i++){
        if(s[i]!=t[i])
            return false;
    }
    return true;
}
void solve() {
    int n;
    cin>>n;
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    int q;
    cin>>q;
    string t;
    cin>>t;
    while(q--){
        int l,r;
        cin>>l>>r;
        char c;
        cin>>c;
        for(int i=l-1;i<r;i++)
            t[i]=c;
        if(check(s1,t))
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //file();
    solve();
    return 0;
}

Compilation message

Main.cpp: In function 'bool check(std::string, std::string)':
Main.cpp:26:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for(int i=0;i<s.size();i++){
      |                 ~^~~~~~~~~
Main.cpp: In function 'void file()':
Main.cpp:18:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     freopen("input.txt.txt","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:19:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     freopen("output.txt.txt","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp: In function 'void file(std::string)':
Main.cpp:22:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |     freopen((s + ".in").c_str(), "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:23:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |     freopen((s + ".out").c_str(), "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp: At global scope:
Main.cpp:15:12: warning: 'called' defined but not used [-Wunused-variable]
   15 | static int called = 0;const long long MOD = 1e9+7; // 1e9 + 7
      |            ^~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 238 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 238 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 238 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 238 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -