Submission #1055058

# Submission time Handle Problem Language Result Execution time Memory
1055058 2024-08-12T14:16:31 Z cpdreamer Crossing (JOI21_crossing) C++14
3 / 100
7000 ms 1836 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;
    if(check(t,s1))
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    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
      |            ^~~~~~
# Verdict Execution time Memory Grader output
1 Correct 203 ms 852 KB Output is correct
2 Correct 237 ms 1108 KB Output is correct
3 Correct 208 ms 804 KB Output is correct
4 Correct 187 ms 852 KB Output is correct
5 Correct 223 ms 784 KB Output is correct
6 Correct 181 ms 972 KB Output is correct
7 Correct 195 ms 852 KB Output is correct
8 Correct 199 ms 848 KB Output is correct
9 Correct 197 ms 852 KB Output is correct
10 Correct 193 ms 1032 KB Output is correct
11 Correct 209 ms 848 KB Output is correct
12 Correct 201 ms 936 KB Output is correct
13 Correct 201 ms 848 KB Output is correct
14 Correct 193 ms 848 KB Output is correct
15 Correct 197 ms 852 KB Output is correct
16 Correct 191 ms 864 KB Output is correct
17 Correct 222 ms 832 KB Output is correct
18 Correct 201 ms 1028 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 203 ms 852 KB Output is correct
2 Correct 237 ms 1108 KB Output is correct
3 Correct 208 ms 804 KB Output is correct
4 Correct 187 ms 852 KB Output is correct
5 Correct 223 ms 784 KB Output is correct
6 Correct 181 ms 972 KB Output is correct
7 Correct 195 ms 852 KB Output is correct
8 Correct 199 ms 848 KB Output is correct
9 Correct 197 ms 852 KB Output is correct
10 Correct 193 ms 1032 KB Output is correct
11 Correct 209 ms 848 KB Output is correct
12 Correct 201 ms 936 KB Output is correct
13 Correct 201 ms 848 KB Output is correct
14 Correct 193 ms 848 KB Output is correct
15 Correct 197 ms 852 KB Output is correct
16 Correct 191 ms 864 KB Output is correct
17 Correct 222 ms 832 KB Output is correct
18 Correct 201 ms 1028 KB Output is correct
19 Execution timed out 7030 ms 1836 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 203 ms 852 KB Output is correct
2 Correct 237 ms 1108 KB Output is correct
3 Correct 208 ms 804 KB Output is correct
4 Correct 187 ms 852 KB Output is correct
5 Correct 223 ms 784 KB Output is correct
6 Correct 181 ms 972 KB Output is correct
7 Correct 195 ms 852 KB Output is correct
8 Correct 199 ms 848 KB Output is correct
9 Correct 197 ms 852 KB Output is correct
10 Correct 193 ms 1032 KB Output is correct
11 Correct 209 ms 848 KB Output is correct
12 Correct 201 ms 936 KB Output is correct
13 Correct 201 ms 848 KB Output is correct
14 Correct 193 ms 848 KB Output is correct
15 Correct 197 ms 852 KB Output is correct
16 Correct 191 ms 864 KB Output is correct
17 Correct 222 ms 832 KB Output is correct
18 Correct 201 ms 1028 KB Output is correct
19 Correct 195 ms 848 KB Output is correct
20 Correct 199 ms 988 KB Output is correct
21 Incorrect 201 ms 852 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 203 ms 852 KB Output is correct
2 Correct 237 ms 1108 KB Output is correct
3 Correct 208 ms 804 KB Output is correct
4 Correct 187 ms 852 KB Output is correct
5 Correct 223 ms 784 KB Output is correct
6 Correct 181 ms 972 KB Output is correct
7 Correct 195 ms 852 KB Output is correct
8 Correct 199 ms 848 KB Output is correct
9 Correct 197 ms 852 KB Output is correct
10 Correct 193 ms 1032 KB Output is correct
11 Correct 209 ms 848 KB Output is correct
12 Correct 201 ms 936 KB Output is correct
13 Correct 201 ms 848 KB Output is correct
14 Correct 193 ms 848 KB Output is correct
15 Correct 197 ms 852 KB Output is correct
16 Correct 191 ms 864 KB Output is correct
17 Correct 222 ms 832 KB Output is correct
18 Correct 201 ms 1028 KB Output is correct
19 Execution timed out 7030 ms 1836 KB Time limit exceeded
20 Halted 0 ms 0 KB -