QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#61554#1371. Missing NumberSilverhorse7#Compile Error//C++20358b2022-11-14 05:51:462022-11-14 05:51:48

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-14 05:51:48]
  • 评测
  • [2022-11-14 05:51:46]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N =2e5;
signed main(){
	int n;
	cin>>n;
	string s;
	cin>>s;
    for (int i = 1; i <= n; i++) {
        string tmp;
        for (int j = 1; j <= n; j++) {
            if (i != j)
            t += to_string(j);
        }
        if(t==s)
        	return cout<<i,0;
    }
    cout<<n+1;
}

Details

answer.code: In function ‘int main()’:
answer.code:13:13: error: ‘t’ was not declared in this scope
   13 |             t += to_string(j);
      |             ^
answer.code:15:12: error: ‘t’ was not declared in this scope
   15 |         if(t==s)
      |            ^