submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s346218413 | p03694 | Java | #include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
#include<deque>
#include <iomanip>
#include<utility>
using namespace std;
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
#define S 21
llfor;ll mod=1e9+7;
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗 1*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
/*n乗 2*/ll modpow(ll x,ll n,ll m){ll ans=x,tmp=x,t1=1;i=1; while(i<n){if(i*2<n){ans*=ans;ans%=m;i*=2;}else{t1=1;tmp=x;while(t1*2<n-i){tmp*=tmp;tmp%=m;t1*=2;}ans*=tmp;ans%=m;i+=t1;}}return ans;}
/*階乗*/ll fact(ll x){ll ans=1;rep(i,0,x){ans*=(x-i);ans%=mod;}return ans;}
/*nCr*/ll ncr(ll n,ll r){ll ans=1,l=2;rep(i,0,min(n-r,r)){ans*=(n-i);ans%=mod;while(ans%l==0&&l<=min(r,n-r)){ans/=l;l++;}}return ans;}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}//素数の時true
/*Fibonacci数列*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=1,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*行列のコピー*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(aをbに)*/i=t;}
/*行列のリセット*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
/*行列の2乗*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
/*行列の乗算*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
//ll ans=0;
////////////////////////////////////////////////////////////
int main(){
ll n;
cin>>n;
vector<ll>a;
ll b;
rep(i,0,n){
cin>>b;
push(a,b);
}
sort(all(a));
ll p=distance(all(a));
ll sum=abs(a[p-1]-a[0]);
ll mx=abs(a[p-1]-a[0]);
rep(i,1,n){
sum+=abs(a[i]-a[i-1]);
mx=max(mx,abs(a[i]-a[i-1]));
}
pr(sum-mx);
return 0;} | Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:2: error: illegal character: '#'
#include<iostream>
^
Main.java:3: error: illegal character: '#'
#include<vector>
^
Main.java:4: error: illegal character: '#'
#include<math.h>
^
Main.java:5: error: illegal character: '#'
#include<queue>
^
Main.java:6: error: illegal character: '#'
#include<map>
^
Main.java:7: error: illegal character: '#'
#include<algorithm>
^
Main.java:8: error: illegal character: '#'
#include<string.h>
^
Main.java:9: error: illegal character: '#'
#include<functional>
^
Main.java:10: error: illegal character: '#'
#include<limits.h>
^
Main.java:11: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:12: error: illegal character: '#'
#include<cmath>
^
Main.java:13: error: illegal character: '#'
#include<cstring>
^
Main.java:14: error: illegal character: '#'
#include<set>
^
Main.java:15: error: illegal character: '#'
#include<climits>
^
Main.java:16: error: illegal character: '#'
#include<deque>
^
Main.java:17: error: illegal character: '#'
#include <iomanip>
^
Main.java:18: error: illegal character: '#'
#include<utility>
^
Main.java:21: error: illegal character: '#'
#define intmax INT_MAX
^
Main.java:22: error: illegal character: '#'
#define lmax LONG_MAX
^
Main.java:23: error: illegal character: '#'
#define uintmax UINT_MAX
^
Main.java:24: error: illegal character: '#'
#define ulmax ULONG_MAX
^
Main.java:25: error: illegal character: '#'
#define llmax LLONG_MAX
^
Main.java:26: error: illegal character: '#'
#define ll long long
^
Main.java:27: error: illegal character: '#'
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
^
Main.java:27: error: class, interface, enum, or record expected
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
^
Main.java:27: error: class, interface, enum, or record expected
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
^
Main.java:28: error: illegal character: '#'
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
^
Main.java:28: error: class, interface, enum, or record expected
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
^
Main.java:28: error: class, interface, enum, or record expected
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
^
Main.java:29: error: illegal character: '#'
#define llfor ll i,j
^
Main.java:30: error: illegal character: '#'
#define sc(a) cin>>a
^
Main.java:31: error: illegal character: '#'
#define pr(a) cout<<a<<endl
^
Main.java:32: error: illegal character: '#'
#define pY puts("YES")
^
Main.java:33: error: illegal character: '#'
#define pN puts("NO")
^
Main.java:34: error: illegal character: '#'
#define py puts("Yes")
^
Main.java:35: error: illegal character: '#'
#define pn puts("No")
^
Main.java:36: error: illegal character: '#'
#define pnn printf("\n")
^
Main.java:37: error: illegal character: '#'
#define all(a) a.begin(),a.end()
^
Main.java:38: error: illegal character: '#'
#define push(a,b) (a).push_back(b)
^
Main.java:39: error: illegal character: '#'
#define llvec vector<vector<ll>>
^
Main.java:40: error: illegal character: '#'
#define charvec vector<vector<char>>
^
Main.java:41: error: illegal character: '#'
#define size(a,b) (a,vector<ll>(b))
^
Main.java:42: error: illegal character: '#'
#define llpvec vector<pair<ll,ll>>
^
Main.java:43: error: illegal character: '#'
#define S 21
^
Main.java:44: error: unnamed classes are a preview feature and are disabled by default.
llfor;ll mod=1e9+7;
^
(use --enable-preview to enable unnamed classes)
Main.java:49: error: ';' expected
/*n? 1*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
^
Main.java:51: error: ';' expected
/*??*/ll fact(ll x){ll ans=1;rep(i,0,x){ans*=(x-i);ans%=mod;}return ans;}
^
Main.java:52: error: ';' expected
/*nCr*/ll ncr(ll n,ll r){ll ans=1,l=2;rep(i,0,min(n-r,r)){ans*=(n-i);ans%=mod;while(ans%l==0&&l<=min(r,n-r)){ans/=l;l++;}}return ans;}
^
Main.java:55: error: not a statement
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
^
Main.java:55: error: ']' expected
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
^
Main.java:55: error: ';' expected
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
^
Main.java:55: error: ';' expected
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
^
Main.java:57: error: ']' expected
/*??????*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(a?b?)*/i=t;}
^
Main.java:57: error: ';' expected
/*??????*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(a?b?)*/i=t;}
^
Main.java:57: error: ';' expected
/*??????*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(a?b?)*/i=t;}
^
Main.java:58: error: ']' expected
/*???????*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
^
Main.java:58: error: ';' expected
/*???????*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
^
Main.java:58: error: ';' expected
/*???????*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
^
Main.java:59: error: not a statement
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:59: error: not a statement
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:59: error: ']' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
^
Main.java:60: error: ']' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
^
Main.java:60: error: ';' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
^
Main.java:60: error: ';' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
^
Main.java:60: error: ';' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
^
Main.java:65: error: not a statement
cin>>n;
^
Main.java:69: error: not a statement
cin>>b;
^
Main.java:68: error: ';' expected
rep(i,0,n){
^
Main.java:76: error: ';' expected
rep(i,1,n){
^
76 errors
|
s780664009 | p03694 | C++ | // lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
#include <bits/stdc++.h>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a,b,c,d,e,n,maxi=0,f=0,mini=INF,sum=0,q;
string str,g;
cin>>n;
vector<ll> v(n);
rep(i,n) cin>>v[i];
sort(all(v));
cout<<v[v.length()-1]-v[0]<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:15: error: 'class std::vector<long long int>' has no member named 'length'
28 | cout<<v[v.length()-1]-v[0]<<endl;
| ^~~~~~
|
s180467080 | p03694 | Java | import java.util.Scanner;
public class Main {
static Scanner scanner;
public static void main(String[] args) {
scanner = new Scanner(System.in);
int n=gi();
int[] A=new int[n];
for(int i=0; i<n;i++) {
A[i]=gi();
}
Arrays.parallelSort(A);
System.out.print(A[A.length-1]-A[0]);
// if (t.equals("Sunny")) {
// System.out.print("Cloudy");
// }else if(t.equals("Cloudy")){
// System.out.print("Rainy");
// } else {
// System.out.print("Sunny");
// }
}
// 文字列として入力を取得
public static String gs() {
return scanner.next();
}
// intとして入力を取得
public static int gi() {
return Integer.parseInt(scanner.next());
}
// longとして入力を取得
public static long gl() {
return Long.parseLong(scanner.next());
}
// doubleとして入力を取得
public static double gd() {
return Double.parseDouble(scanner.next());
}
} | Main.java:17: error: cannot find symbol
Arrays.parallelSort(A);
^
symbol: variable Arrays
location: class Main
1 error
|
s374157886 | p03694 | C | #include <stdio.h>
int main(void)
{
int n,a[1000],max,min,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
max=a[0]; min=a[0];
for(i=0;i<n;i++){
if(max=<a[i]) max=a[i];
else if(min=>a[i]) min=a[i];
}
printf("%d",max-min);
return 0;
} | main.c: In function 'main':
main.c:17:17: error: expected expression before '<' token
17 | if(max=<a[i]) max=a[i];
| ^
main.c:18:22: error: expected expression before '>' token
18 | else if(min=>a[i]) min=a[i];
| ^
|
s348756313 | p03694 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<tuple>
#include<vector>
#include<cstdlib>
#include<cstdint>
#include<stdio.h>
#include<cmath>
#include<limits>
#include<iomanip>
#include<ctime>
#include<climits>
#include<random>
#include<queue>
#include<map>
using namespace std;
template <class T> using V = vector<T>;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
const long long INF = 1LL << 60;
const double pi=acos(-1);
using ll = long long;
using db = long double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using graph = V<V<int>>;
using pq = priority_queue<ll>;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a);
#define ALL(a) (a).begin(),(a).end()
ll Sum(ll n) {
ll m=0;
while(n){
m+=n%10;
n/=10;
}
return m;
}
const int MAX = 510000;
// change
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void Comuse() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
#define comuse Comuse()
ll combi(int n, int k){
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll perm(int n,int k){
if(n < k) return 0;
if(n < 0 || k < 0) return 0;
return fac[n] * (finv[k] % MOD) % MOD;
}
ll modpow(ll a,ll n,ll mod){
ll ans=1;
while(n>0){
if(n&1){
ans=ans*a%mod;
}
a=a*a%mod;
n>>=1;
}
return ans;
}
ll modinv(ll a, ll mod) {
return modpow(a, mod - 2, mod);
}
ll modcombi(int n,int k,int mod){
ll ans=1;
for(ll i=n;i>n-k;i--){
ans*=i;
ans%=mod;
}
for(ll i=1;i<=k;i++){
ans*=modinv(i,mod);
ans%=mod;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
vll div(ll n){
vll ret;
for(ll i=1;i*i<=n;i++){
if(n%i==0){
ret.push_back(i);
if(i*i!=n){
ret.push_back(n/i);
}
}
}
SORT(ret);
return (ret);
}
vector<bool> isprime(MAX+100,true);
void primeuse(){
isprime[0]=false;
isprime[1]=false;
for(int i=2;i<MAX+50;i++){
int up=sqrt(i)+1;
for(int j=2;j<up;j++){
if(i%j==0){
isprime[i]=false;
}
}
}
}
void bf(ll n,string s){
for(ll i=0;i<n;i++){
cout<<s;
}
cout<<"\n";
}
int main(void){
int n;
scanf("%d",&n);
int A[n];
int i;
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
SORT(A);
printf("%d\n",A[n-1]-A[0]);
return 0;
} | a.cc: In function 'int main()':
a.cc:57:13: error: request for member 'begin' in 'A', which is of non-class type 'int [n]'
57 | #define bgn begin()
| ^~~~~
a.cc:59:26: note: in expansion of macro 'bgn'
59 | #define SORT(a) sort((a).bgn,(a).en)
| ^~~
a.cc:201:9: note: in expansion of macro 'SORT'
201 | SORT(A);
| ^~~~
a.cc:58:12: error: request for member 'end' in 'A', which is of non-class type 'int [n]'
58 | #define en end()
| ^~~
a.cc:59:34: note: in expansion of macro 'en'
59 | #define SORT(a) sort((a).bgn,(a).en)
| ^~
a.cc:201:9: note: in expansion of macro 'SORT'
201 | SORT(A);
| ^~~~
|
s260021759 | p03694 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<tuple>
#include<vector>
#include<cstdlib>
#include<cstdint>
#include<stdio.h>
#include<cmath>
#include<limits>
#include<iomanip>
#include<ctime>
#include<climits>
#include<random>
#include<queue>
#include<map>
using namespace std;
template <class T> using V = vector<T>;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
const long long INF = 1LL << 60;
const double pi=acos(-1);
using ll = long long;
using db = long double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using graph = V<V<int>>;
using pq = priority_queue<ll>;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a);
#define ALL(a) (a).begin(),(a).end()
ll Sum(ll n) {
ll m=0;
while(n){
m+=n%10;
n/=10;
}
return m;
}
const int MAX = 510000;
// change
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void Comuse() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
#define comuse Comuse()
ll combi(int n, int k){
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll perm(int n,int k){
if(n < k) return 0;
if(n < 0 || k < 0) return 0;
return fac[n] * (finv[k] % MOD) % MOD;
}
ll modpow(ll a,ll n,ll mod){
ll ans=1;
while(n>0){
if(n&1){
ans=ans*a%mod;
}
a=a*a%mod;
n>>=1;
}
return ans;
}
ll modinv(ll a, ll mod) {
return modpow(a, mod - 2, mod);
}
ll modcombi(int n,int k,int mod){
ll ans=1;
for(ll i=n;i>n-k;i--){
ans*=i;
ans%=mod;
}
for(ll i=1;i<=k;i++){
ans*=modinv(i,mod);
ans%=mod;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
vll div(ll n){
vll ret;
for(ll i=1;i*i<=n;i++){
if(n%i==0){
ret.push_back(i);
if(i*i!=n){
ret.push_back(n/i);
}
}
}
SORT(ret);
return (ret);
}
vector<bool> isprime(MAX+100,true);
void primeuse(){
isprime[0]=false;
isprime[1]=false;
for(int i=2;i<MAX+50;i++){
int up=sqrt(i)+1;
for(int j=2;j<up;j++){
if(i%j==0){
isprime[i]=false;
}
}
}
}
void bf(ll n,string s){
for(ll i=0;i<n;i++){
cout<<s;
}
cout<<"\n";
}
int main(void){
int n;
scanf("%d",&n);
int goal=0;
int start=10000;
min=A[0];
max=A[0];
int i;
for(i=0;i<n;i++){
int now;
scanf("%d",&now);
if(now<start){
start=now;
}
if(goal<now){
goal=now;
}
}
printf("%d\n",goal-start);
return 0;
}
| a.cc: In function 'int main()':
a.cc:196:9: error: 'A' was not declared in this scope
196 | min=A[0];
| ^
|
s660201151 | p03694 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
for(int i = 0;i < n;i++){
cin >> a[i];
}
/**/
sort(a.begin(),a.end());
cout << abs(a[n - 1] - a[0]) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(a.begin(),a.end());
| ^~~~
| short
|
s017719512 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,i,x;
cin >> n;
int number[n];
for (i = 1; i <= N; i++)
{
cin >> number[i];
}
int max,min= 0;
max = min = number[0];
for(x = 1; x <= N; x++)
{
if(number[x] > max)
max = number[x];
if(number[x] < min)
min = number[x];
}
cout << max-min<< endl;
}
| a.cc: In function 'int main()':
a.cc:8:19: error: 'N' was not declared in this scope
8 | for (i = 1; i <= N; i++)
| ^
a.cc:16:17: error: 'N' was not declared in this scope
16 | for(x = 1; x <= N; x++)
| ^
|
s820536493 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,i,x;
cin >> n;
int number[n];
for (i = 1; i <= n; i++)
{
cin >> number[i];
}
int max,min= 0;
max = min = number[0];
/
for(x = 1; x <= n; x++)
{
if(number[x] > max)
max = number[x];
if(number[x] < min)
min = number[x];
}
cout << max-min<< endl;
}
| a.cc: In function 'int main()':
a.cc:15:1: error: expected primary-expression before '/' token
15 | /
| ^
a.cc:16:1: error: expected primary-expression before 'for'
16 | for(x = 1; x <= n; x++)
| ^~~
a.cc:16:23: error: expected ';' before ')' token
16 | for(x = 1; x <= n; x++)
| ^
| ;
|
s249727135 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,i,x;
cin >> n;
int number[n];
for (i = 1; i <= n; i++)
{
cin >> number[i];
}
int max,min= 0;
max = min = number[0];
/
for(x = 1; x <= n; x+)
{
if(number[x] > max)
max = number[x];
if(number[x] < min)
min = number[x];
}
cout << max-min<< endl;
}
| a.cc: In function 'int main()':
a.cc:15:1: error: expected primary-expression before '/' token
15 | /
| ^
a.cc:16:1: error: expected primary-expression before 'for'
16 | for(x = 1; x <= n; x+)
| ^~~
a.cc:16:22: error: expected primary-expression before ')' token
16 | for(x = 1; x <= n; x+)
| ^
|
s445012145 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,a,i,x;
cin >> n;
int number[n];
for (i = 1; i <= n; i++)
{
cin >> number[i];
}
int max,min= 0;
max = min = number[0];
/
for(x = 1; x <= n; x+)
{
if(number[x] > max)
max = number[x];
if(number[x] < min)
min = number[x];
}
cout << max-min<< endl;
}
| a.cc: In function 'int main()':
a.cc:15:1: error: expected primary-expression before '/' token
15 | /
| ^
a.cc:16:1: error: expected primary-expression before 'for'
16 | for(x = 1; x <= n; x+)
| ^~~
a.cc:16:22: error: expected primary-expression before ')' token
16 | for(x = 1; x <= n; x+)
| ^
|
s278314298 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int res=v[0];
for(int i=0 ; i<N ; i++){
res=min(res,v[i]);
}
int res1 = v[o];
for(int i=0 ; i<N; i++){
res1= max(res1,v[i]);
}
cout << res1-res<<endl;
}
| a.cc: In function 'int main()':
a.cc:5:9: error: 'v' was not declared in this scope
5 | int res=v[0];
| ^
a.cc:6:17: error: 'N' was not declared in this scope
6 | for(int i=0 ; i<N ; i++){
| ^
a.cc:9:15: error: 'o' was not declared in this scope
9 | int res1 = v[o];
| ^
a.cc:10:19: error: 'N' was not declared in this scope
10 | for(int i=0 ; i<N; i++){
| ^
|
s756083653 | p03694 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n=Integer.parseInt(sc.next());
int[] a=new int[n];
for(int i=0;i<n;i++){
a[i]=Integer.parseInt(sc.next());
}
Array.sort(a);
System.out.println(a[n-1]-a[0]);
}
}
| Main.java:12: error: cannot find symbol
Array.sort(a);
^
symbol: variable Array
location: class Main
1 error
|
s532120471 | p03694 | C++ | #include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
void solve(long long N, std::vector<long long> a){
sort(a.begin(), a.end());
cout << a[N - 1] - a[0] << '\n';
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
long long N;
scanf("%lld",&N);
std::vector<long long> a(N);
for(int i = 0 ; i < N ; i++){
scanf("%lld",&a[i]);
}
solve(N, std::move(a));
return 0;
}
| a.cc: In function 'void solve(long long int, std::vector<long long int>)':
a.cc:7:5: error: 'sort' was not declared in this scope; did you mean 'short'?
7 | sort(a.begin(), a.end());
| ^~~~
| short
|
s516443241 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
int a[n];
REP(i, 0, n) cin >> a[i];
sort(a, a + n);
cout << a[n - 1] - a[0];
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'i' was not declared in this scope
12 | REP(i, 0, n) cin >> a[i];
| ^
a.cc:12:9: error: 'REP' was not declared in this scope
12 | REP(i, 0, n) cin >> a[i];
| ^~~
|
s205373995 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new.Scanner(System.in);
int N =sc.nextInt();
int a=sc.nextInt();
for(int i=1;i<N;i++){
int Min;
int Max;
if(Min>a)Min=a;
if(Max<a)Max=a;
System.out.println(Max-Min);}
}
}
| Main.java:4: error: <identifier> expected
Scanner sc=new.Scanner(System.in);
^
1 error
|
s433871962 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int N =sc.nextInt();
int a=sc.nextInt();
for(int i=1;i<N;i++){
int Min;
int Max;
if(Min>a)Min=a;
if(Max<a)Max=a;
System.out.println(Max-Min);}
}
} | Main.java:4: error: cannot find symbol
int N =sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:5: error: cannot find symbol
int a=sc.nextInt();
^
symbol: variable sc
location: class Main
2 errors
|
s270826005 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int N = sc.nextInt();
int a = sc.nextInt();
for(int i=1;i<N;i++){
int Min=a;
int Max=a;
System.out.println(Max-Min);}
}
}
| Main.java:4: error: cannot find symbol
int N = sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:5: error: cannot find symbol
int a = sc.nextInt();
^
symbol: variable sc
location: class Main
2 errors
|
s681275371 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int N,a,Min,Max;
for(int i=1;i<N;i++){
if(Min>a)Min=a;
if(Max<a)Max=a;
System.out.println(Max-Min);}
}
}
| Main.java:5: error: variable N might not have been initialized
for(int i=1;i<N;i++){
^
Main.java:6: error: variable Min might not have been initialized
if(Min>a)Min=a;
^
Main.java:6: error: variable a might not have been initialized
if(Min>a)Min=a;
^
Main.java:7: error: variable Max might not have been initialized
if(Max<a)Max=a;
^
4 errors
|
s538338781 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int N =sc.nextInt();
int a=sc.nextInt();
int Min;
int Max;
for(int i=1;i<N;i++){
if(Min>a)Min=a;
if(Max<a)Max=a;
System.out.println(Max-Min);}
}
}
| Main.java:4: error: cannot find symbol
int N =sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:5: error: cannot find symbol
int a=sc.nextInt();
^
symbol: variable sc
location: class Main
2 errors
|
s651885557 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int N =sc.nextInt();
int a=sc.nextInt();
int Min;
int Max;
for(int i=1;i<N;i++){
if(Min>a)Min=a;
if(Max<a)Max=a;
System.out.println(Max-Min);}
}
}
| Main.java:4: error: cannot find symbol
int N =sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:5: error: cannot find symbol
int a=sc.nextInt();
^
symbol: variable sc
location: class Main
2 errors
|
s772974934 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int N =sc.nextInt();
int a=sc.nextInt();
for(int i=1;i<N;i++){
int Min;
int Max;
if(Min>a)Min=a;
if(Max<a)Max=a;}
System.out.println(Max-Min);}
}
| Main.java:4: error: cannot find symbol
int N =sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:5: error: cannot find symbol
int a=sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:11: error: cannot find symbol
System.out.println(Max-Min);}
^
symbol: variable Max
location: class Main
Main.java:11: error: cannot find symbol
System.out.println(Max-Min);}
^
symbol: variable Min
location: class Main
4 errors
|
s850961415 | p03694 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int N =sc.nextInt();
int a=sc.nextInt();
for(int i=1;i<N;i++){
int Min;
int Max;
if(Min>a)Min=a;
if(Max<a)Max=a;}
System.out.println(Max-Min);}
| Main.java:11: error: reached end of file while parsing
System.out.println(Max-Min);}
^
1 error
|
s010465856 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int ctoi(const char c) {
if ('0' <= c && c <= '9') return (c - '0');
return -1;
}
vector<int> input(int n) {
vector<int> vec(n);
for (int i = 0; i < n; i++) {
cin >> vec.at(i);
}
return vec;
}
void output(vector<int> vec) {
for (int i = 0; i < vec.size(); i++) {
cout << vec[i] << " ";
}
return;
}
vector<vector<int>> input(int n, int m) {
vector<vector<int>> table(n, vector<int>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> table. at(i).at(j);
}
}
return table;
}
void output(vector<vector<int>> table) {
for (int i = 0; i < table.size(); i++) {
for (int j = 0; j < table.at(0).size(); j++) {
cout << table.at(i).at(j) << " ";
}
cout << endl;
}
}
long long perm(int n, int r) {
if (n < r) {
cout << "error" << endl;
return 0;
}
long long perm = 1;
for (int i = n; i > n - r; i--) {
perm *= i;
}
return perm;
}
long long comb(int n, int r) {
if (n < r) {
cout << "error" << endl;
return 0;
}
long long comb = perm(n,r);
for (int i = r; i > 0; i--) {
comb /= i;
}
return comb;
}
long long homo(int n, int r) {
return comb(n + r - 1, n - 1);
}
long long fact(int n) {
long long fact = 1;
for (int i = n; i > 0; i--) {
fact *= i;
}
return fact;
}
int gcd(int a, int b)
{
if (a % b == 0)
{
return(b);
}
else
{
return(gcd(b, a % b));
}
}
int lcm(int a, int b) {
return a * b / gcd(a, b);
}
int main() {
int n;
cin >> n;
vector<int> a=input(n);
sort(a.begin(),a.end());
cout << s[n-1]-s[0] << endl;
} | a.cc: In function 'int main()':
a.cc:89:11: error: 's' was not declared in this scope
89 | cout << s[n-1]-s[0] << endl;
| ^
|
s312684929 | p03694 | C | #include <stdio.h>
int main (void)
{
int n , min = 10000 , max = 0;
scanf("%d",&n);
int a[n];
for(int i = 0;i < n; i ++){
scanf("%d",&a[i]);
if(min>a[i]){
min = a[i];
}
if(max<a[i]){
max = a[i];
}}
printf("%d",max - min);
return 0; | main.c: In function 'main':
main.c:18:2: error: expected declaration or statement at end of input
18 | return 0;
| ^~~~~~
|
s395648627 | p03694 | C++ | #include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
int main(void) {
int N;cin>>N;
vector<int> A(N);
for (int i = 0; i < N; i++) cin>>A[i];
vector<int> index(N);
for (int i = 0 ;i < N; i++) index.push_back(i);
int mi = 1e9;
do {
int cur = 0;
for (int i = 0; i < N - 1; i++) {
cur += abs(A[i] - A[i + 1]);
}
if (mi > cur) mi = cur;
} while (next_permutation(A.begin(), A.end()));
cout << mi << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:14: error: 'next_permutation' was not declared in this scope
19 | } while (next_permutation(A.begin(), A.end()));
| ^~~~~~~~~~~~~~~~
|
s840146844 | p03694 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(void)
{
int n; cin>>n;
vector<int> a(n);
for(int i=0;i<n;i++){
cin>>a[i];
}
int mx=*max_element(a.begin(),a.end());
int mi=*min_element(a.begin(),a.end());
cout<<mx-mi<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
9 | vector<int> a(n);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include<algorithm>
+++ |+#include <vector>
3 |
a.cc:9:10: error: expected primary-expression before 'int'
9 | vector<int> a(n);
| ^~~
a.cc:11:10: error: 'a' was not declared in this scope
11 | cin>>a[i];
| ^
a.cc:14:23: error: 'a' was not declared in this scope
14 | int mx=*max_element(a.begin(),a.end());
| ^
|
s019021947 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
vector<int> vec(N);
for(int i=0;i<N;i++) {
cin>>vec.at(i);
}
sort(vec);
int ans=vec.at(N)-vec.at(1);
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:7: error: no matching function for call to 'sort(std::vector<int>&)'
11 | sort(vec);
| ~~~~^~~~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
|
s596848266 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin>>N;
vector(N) vec;
for(i=0;i<N;i++) {
cin>>vec.at(i);
}
sort(vec);
int ans=vec.at(N)-vec.at(1);
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:11: error: class template argument deduction failed:
7 | vector(N) vec;
| ^
a.cc:7:11: error: no matching function for call to 'vector(int&)'
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::initializer_list<_Tp>, const _Alloc&)-> std::vector<_Tp, _Alloc>'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:7: note: template argument deduction/substitution failed:
a.cc:7:11: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | vector(N) vec;
| ^
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::false_type)-> std::vector<_Tp, _Alloc>'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&, const _Alloc&, std::true_type)-> std::vector<_Tp, _Alloc>'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)-> std::vector<_Tp, _Alloc>'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>&&)-> std::vector<_Tp, _Alloc>'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: template argument deduction/substitution failed:
a.cc:7:11: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
7 | vector(N) vec;
| ^
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const std::vector<_Tp, _Alloc>&)-> std::vector<_Tp, _Alloc>'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: template argument deduction/substitution failed:
a.cc:7:11: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
7 | vector(N) vec;
| ^
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Tp&, const _Alloc&)-> std::vector<_Tp, _Alloc>'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'template<class _Tp, class _Alloc> vector(std::size_t, const _Alloc&)-> std::vector<_Tp, _Alloc>'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: template argument deduction/substitution failed:
a.cc:7:11: note: couldn't deduce template parameter '_Tp'
7 | vector(N) vec;
| ^
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'template<class _Tp, class _Alloc> vector(const _Alloc&)-> std::vector<_Tp, _Alloc>'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: template argument deduction/substitution failed:
a.cc:7:11: note: couldn't deduce template parameter '_Tp'
7 | vector(N) vec;
| ^
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'template<class _Tp, class _Alloc> vector()-> std::vector<_Tp, _Alloc>'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:428:11: note: candidate: 'template<class _Tp, class _Alloc> vector(std::vector<_Tp, _Alloc>)-> std::vector<_Tp, _Alloc>'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:428:11: note: template argument deduction/substitution failed:
a.cc:7:11: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int'
7 | vector(N) vec;
| ^
/usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Allocator, class, class> std::vector(_InputIterator, _InputIterator, _Allocator)-> vector<_ValT, _Allocator>'
2033 | vector(_InputIterator, _InputIterator, _Allocator = _Allocator())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:2033:5: note: candidate expects 2 arguments, 1 provided
a.cc:8:7: error: 'i' was not declared in this scope
8 | for(i=0;i<N;i++) {
| ^
a.cc:9:10: error: 'vec' was not declared in this scope
9 | cin>>vec.at(i);
| ^~~
a.cc:11:8: error: 'vec' was not declared in this scope
11 | sort(vec);
| ^~~
|
s780192955 | p03694 | C++ | // #include <iostream>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v.at(i);
}
sort(v.begin(), v.end());
cout << v.end() - v.begin() << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
19 | sort(v.begin(), v.end());
| ^~~~
| short
|
s710853210 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int N,min,max;
max = 0;
min = 1000;
cin >> N;
long a[N];
for(int i=0;i<N;i++){
cin >> a[i];
min = min(a[i],min);
max = max(a[i],max);
}
cout << max-min << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:14: error: 'min' cannot be used as a function
12 | min = min(a[i],min);
| ~~~^~~~~~~~~~
a.cc:13:14: error: 'max' cannot be used as a function
13 | max = max(a[i],max);
| ~~~^~~~~~~~~~
|
s048865392 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> t(N);
for(int i = 0; i < N; i++){
cin >> t.at(i);
}
cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
} | a.cc: In function 'int main()':
a.cc:13:82: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: couldn't deduce template parameter '_Bi_iter'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: couldn't deduce template parameter '_Bi_iter'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:13:84: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/u |
s361401304 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int n; cin >> n;
int A[n];
for (int i = 0; i < n; i++) cin >> A[i];
sort(A, A + n);
cout << A[n - 1] - A[0] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'short'?
7 | sort(A, A + n);
| ^~~~
| short
|
s090712163 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> a(N);
for (int i = 0; i < N; i++) {
cin >> a[i];
}
sort(a.begin(),a.end());
int ans = A[N - 1] - A[0];
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:13: error: 'A' was not declared in this scope
11 | int ans = A[N - 1] - A[0];
| ^
|
s306151864 | p03694 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>>vvi;
int main(){
int n;cin>>n;
vi a(n);
rep(i,n)cin>>a[i];
MIN=a[0],MAX=a[0];
rep(i,n){
MIN=min(MIN,a[i]);
MAX=max(MAX,a[i]);
}
cout<<MAX-MIN<<endl;
} | a.cc: In function 'int main()':
a.cc:16:3: error: 'MIN' was not declared in this scope
16 | MIN=a[0],MAX=a[0];
| ^~~
a.cc:16:12: error: 'MAX' was not declared in this scope
16 | MIN=a[0],MAX=a[0];
| ^~~
|
s601100003 | p03694 | C++ | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << '\n'
typedef int64_t Int;
const double pi = M_PI;
using namespace std;
int main() {
int N;
cin >> N;
int a[N];
for (int i = 0; i < N; i++) {
cin >> a[i];
}
sort(a[0], a[N - 1]);
cout << a[N - 1] - a[0] << endl;
}
| In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:9: required from here
19 | sort(a[0], a[N - 1]);
| ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int')
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int')
1782 | *__first = _GLIBCXX_MOVE(__val);
| ^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]':
/usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1777 | if (__comp(__i, __first))
| ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:9: required from here
19 | sort(a[0], a[N - 1]);
| ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algo.h:61:
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1593 | std::__make_heap(__first, __middle, __comp);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:9: required from here
19 | sort(a[0], a[N - 1]);
| ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
344 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
346 | _DistanceType;
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1596 | std::__pop_heap(__first, __middle, __i, __comp);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:19:9: required from here
19 | sort(a[0], a[N - 1]);
| ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
258 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
260 | _DistanceType;
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:262:28: error: invalid type argument of unary '*' (have 'int')
262 | _ValueType __value = _GLIBCXX_MOVE(*__result);
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:263:7: error: invalid type argument of unary '*' (have 'int')
263 | *__result = _GLIBCXX_MOVE(*__first);
| ^~~~~~~~~
/usr/include/c++/14/b |
s493391466 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
sort(a+1,a+n+1);
cout<<a[n]-a[1];
return 0;
} | a.cc: In function 'int main()':
a.cc:7:35: error: 'a' was not declared in this scope
7 | for(int i=1;i<=n;i++)cin>>a[i];
| ^
a.cc:8:14: error: 'a' was not declared in this scope
8 | sort(a+1,a+n+1);
| ^
|
s720863340 | p03694 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int a[] = new a[n];
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
}
Arrays.sort(a);
System.out.println(a[n-1] - a[0]);
}
}
| Main.java:6: error: cannot find symbol
int a[] = new a[n];
^
symbol: class a
location: class Main
1 error
|
s172568315 | p03694 | C++ | #include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define ci(n) cin >> n
#define co(n) cout << n << endl
using namespace std;
int main(){
long n;
cin >> n;
int [n];
rep(i,0,n) cin >> a[i];
sort(a, a+n);
co(a[n-1]-a[0]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:7: error: structured binding declaration cannot have type 'int'
10 | int [n];
| ^~~
a.cc:10:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:10:8: error: conflicting declaration 'auto n'
10 | int [n];
| ^
a.cc:8:8: note: previous declaration as 'long int n'
8 | long n;
| ^
a.cc:10:10: error: expected initializer before ';' token
10 | int [n];
| ^
a.cc:11:21: error: 'a' was not declared in this scope
11 | rep(i,0,n) cin >> a[i];
| ^
a.cc:12:8: error: 'a' was not declared in this scope
12 | sort(a, a+n);
| ^
|
s814733439 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
int i;
for(i=0;i<n;i++){
cin >> a[i];
}
sort(a.begin(), a.end(),);
cout << a[n-1]-a[0];
}
| a.cc: In function 'int main()':
a.cc:12:27: error: expected primary-expression before ')' token
12 | sort(a.begin(), a.end(),);
| ^
|
s329958040 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
int i;
for(i=0;i<n;i++){
cin >> a[i];
}
sort(a.begin(), a.end(),);
cout >> a[n-1]-a[0];
}
| a.cc: In function 'int main()':
a.cc:12:27: error: expected primary-expression before ')' token
12 | sort(a.begin(), a.end(),);
| ^
a.cc:13:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
13 | cout >> a[n-1]-a[0];
| ~~~~ ^~
| |
| std::ostream {aka std::basic_ostream<char>}
a.cc:13:8: note: candidate: 'operator>>(int, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int})' (built-in)
13 | cout >> a[n-1]-a[0];
a.cc:13:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:13:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
13 | cout >> a[n-1]-a[0];
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]':
a.cc:13:21: required from here
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:13:21: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> a[n-1]-a[0];
| ^
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istrea |
s483841710 | p03694 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define REP(i,n) for(i=0;i<n;i++)
#define MOD 1000000007
//prototype declaration
int iin();
long long llin();
double din();
char cin();
void stin(char *s);
void iout(int i);
void llout(long long i);
void dout(double i);
void cout(char c);
void stout(char *s);
int gcd(int a, int b);
int lcm(int a, int b);
long long llgcd(long long a, long long b);
long long lllcm(long long a, long long b);
void sortAsc(int *a);
void sortDesc(int *a);
int asc(const void *a, const void *b);
int desc(const void *a, const void *b);
void llSortAsc(long long *a);
void llSortDesc(long long *a);
int llAsc(const void *a, const void *b);
int llDesc(const void *a, const void *b);
double toDeg(double rad);
double distance(int xi, int yi, int xj, int yj);
//main function
int main() {
int n = iin(), i, a, a_min = MOD, a_max = -1;
REP(i,n) {
a = iin();
if (a < a_min) a_min = a;
if (a > a_max) a_max = a;
}
iout(a_max - a_min);
return 0;
}
//body function
int iin() {
int i;
scanf("%d", &i);
return i;
}
long long llin() {
long long i;
scanf("%lld", &i);
return i;
}
double din() {
double i;
scanf("%lf", &i);
return i;
}
char cin() {
char c;
scanf("%c", &c);
return c;
}
void stin(char *s) {
scanf("%s", s);
}
void iout(int i) {
printf("%d\n", i);
}
void llout(long long i) {
printf("%lld\n", i);
}
void dout(double i) {
printf("%lf\n", i);
}
void cout(char c) {
printf("%c\n", c);
}
void stout(char *s) {
printf("%s\n", s);
}
/*
int型の最大公約数
*/
int gcd(int a, int b) {
int r;
if (a < b) {
r = a;
a = b;
b = r;
}
r = a % b;
while (r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
/*
int型の最小公倍数
*/
int lcm(int a, int b) {
int r = llgcd(a, b);
a /= r;
return a * b;
}
/*
long long型の最大公約数
*/
long long llgcd(long long a, long long b) {
long long r;
if (a < b) {
r = a;
a = b;
b = r;
}
r = a % b;
while (r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
/*
long long型の最小公倍数
*/
long long lllcm(long long a, long long b) {
long long r = llgcd(a, b);
a /= r;
return a * b;
}
/*
int型の昇順ソート
*/
void sortAsc(int *a) {
qsort(a, sizeof(a), sizeof(int), sizeof(int), asc);
}
/*
int型の降順ソート
*/
void sortDesc(int *a) {
qsort(a, sizeof(a), sizeof(int), sizeof(int), desc);
}
/*
int型の昇順用比較関数
*/
int asc(const void *a, const void *b) {
return *(int *)a - *(int *)b;
}
/*
int型の降順用比較関数
*/
int desc(const void *a, const void *b) {
return *(int *)b - *(int *)a;
}
/*
long long型の昇順ソート
*/
void llSortAsc(long long *a) {
qsort(a, sizeof(a), sizeof(long long), sizeof(long long), llAsc);
}
/*
long long型の降順ソート
*/
void llSortDesc(long long *a) {
qsort(a, sizeof(a), sizeof(long long), sizeof(long long), llDesc);
}
/*
long long型の昇順用比較関数
*/
int llAsc(const void *a, const void *b) {
long long *A = (long long *)a;
long long *B = (long long *)b;
if (*A > *B) return 1;
else if (*A < *B) return -1;
else return 0;
}
/*
long long型の降順用比較関数
*/
int llDesc(const void *a, const void *b) {
long long *A = (long long *)a;
long long *B = (long long *)b;
if (*A < *B) return 1;
else if (*A > *B) return -1;
else return 0;
}
/*
弧度法を度数法に
*/
double toDeg(double rad) {
return rad * 180.0 / (atan(1.0) * 4.0);
}
/*
二点間の距離
*/
double distance(int xi, int yi, int xj, int yj) {
return hypot(xj - xi, yj - yi);
}
| main.c: In function 'sortAsc':
main.c:169:38: error: passing argument 4 of 'qsort' makes pointer from integer without a cast [-Wint-conversion]
169 | qsort(a, sizeof(a), sizeof(int), sizeof(int), asc);
| ^~~~~~~~~~~
| |
| long unsigned int
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long unsigned int'
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
main.c:169:5: error: too many arguments to function 'qsort'
169 | qsort(a, sizeof(a), sizeof(int), sizeof(int), asc);
| ^~~~~
/usr/include/stdlib.h:970:13: note: declared here
970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
| ^~~~~
main.c: In function 'sortDesc':
main.c:177:38: error: passing argument 4 of 'qsort' makes pointer from integer without a cast [-Wint-conversion]
177 | qsort(a, sizeof(a), sizeof(int), sizeof(int), desc);
| ^~~~~~~~~~~
| |
| long unsigned int
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long unsigned int'
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
main.c:177:5: error: too many arguments to function 'qsort'
177 | qsort(a, sizeof(a), sizeof(int), sizeof(int), desc);
| ^~~~~
/usr/include/stdlib.h:970:13: note: declared here
970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
| ^~~~~
main.c: In function 'llSortAsc':
main.c:201:44: error: passing argument 4 of 'qsort' makes pointer from integer without a cast [-Wint-conversion]
201 | qsort(a, sizeof(a), sizeof(long long), sizeof(long long), llAsc);
| ^~~~~~~~~~~~~~~~~
| |
| long unsigned int
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long unsigned int'
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
main.c:201:5: error: too many arguments to function 'qsort'
201 | qsort(a, sizeof(a), sizeof(long long), sizeof(long long), llAsc);
| ^~~~~
/usr/include/stdlib.h:970:13: note: declared here
970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
| ^~~~~
main.c: In function 'llSortDesc':
main.c:209:44: error: passing argument 4 of 'qsort' makes pointer from integer without a cast [-Wint-conversion]
209 | qsort(a, sizeof(a), sizeof(long long), sizeof(long long), llDesc);
| ^~~~~~~~~~~~~~~~~
| |
| long unsigned int
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long unsigned int'
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
main.c:209:5: error: too many arguments to function 'qsort'
209 | qsort(a, sizeof(a), sizeof(long long), sizeof(long long), llDesc);
| ^~~~~
/usr/include/stdlib.h:970:13: note: declared here
970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
| ^~~~~
|
s676331796 | p03694 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int N, a[101], i;
cin >> N;
for(i=1; i<=N; i++){
cin >> a[i];
}
sort(a+1, a+N+1);
cout << a[N]-a[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(a+1, a+N+1);
| ^~~~
| short
|
s840784043 | p03694 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> A(N);
for (int i=0; i<N; i++){
cin >> A[i];
}
int MAX, MIN;
MAX = *max_element(A.begin(), A.end());
MIN = *min_element(A.begin(), A.end());
cout << MAX-MIN << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:10: error: 'max_element' was not declared in this scope
15 | MAX = *max_element(A.begin(), A.end());
| ^~~~~~~~~~~
a.cc:16:10: error: 'min_element' was not declared in this scope
16 | MIN = *min_element(A.begin(), A.end());
| ^~~~~~~~~~~
|
s178746581 | p03694 | C++ | #include<stdio.h>
int main(){
int a[100];
int n, bufx, bufm;
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%d", a[i]);
}
for(i = 1; i < n; i++){
if(a[i] < a[0]){
bufx = a[0];
a[0] = a[i];
a[i] = bufx;
}else if(a[i] > a[n - 1]){
bufm = a[n - 1];
a[n - 1] = a[i];
a[i] = bufm;
}
}
printf("%d", a[n-1] - a[0]);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
9 | for(i = 1; i < n; i++){
| ^
|
s589470587 | p03694 | C++ | #include <cstdio>
#include <algorithm>
int main()
{
int N;
scanf("%d", &N);
int a[105];
for(int i = 0; i < N; i++)
{
scanf("%d", &a[i])
}
sort(a,a+N)
printf("%d", a[N - 1] - a[0]);
} | a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before '}' token
13 | scanf("%d", &a[i])
| ^
| ;
14 | }
| ~
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
15 | sort(a,a+N)
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
|
s134077153 | p03694 | C++ | #include <cstdio>
#include <algorithm>
int main(){
int N, a[100];
scanf("%d", &N);
for(int i=0; i<N; i++){
scanf("%d", &a[i]);
}
sort(a, a+n);
printf("%d", a[N-1]-a[0]);
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'n' was not declared in this scope
9 | sort(a, a+n);
| ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
9 | sort(a, a+n);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
|
s343275133 | p03694 | C++ | #include<cstdio>
#include<algorithm>
int main(){
int n;
scanf("%d",&n);
int a[100];
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
sort(a,a+n);
print("%d",a[n-1]-a[0]);
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
11 | sort(a,a+n);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
a.cc:12:9: error: 'print' was not declared in this scope; did you mean 'printf'?
12 | print("%d",a[n-1]-a[0]);
| ^~~~~
| printf
|
s607696492 | p03694 | C++ | #include <cstdio>
#include <algorithm>
int main(){
int N, a[100];
scanf("%d", &N);
for(int i=0; i<N; i++){
scanf("%d", a[i]);
}
sort(a, a+n);
printf("%d", a[N-1]-a[0]);
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'n' was not declared in this scope
9 | sort(a, a+n);
| ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
9 | sort(a, a+n);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
|
s331095561 | p03694 | C++ | #include <cstdio>
#include <algorithm>
int main(){
int N, a[100];
scnf("%d", &N);
for(int i=0; i<N; i++){
scanf("%d", a[i]);
}
sort(a, a+n);
printf("%d", a[N-1]-a[0]);
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'scnf' was not declared in this scope; did you mean 'scanf'?
5 | scnf("%d", &N);
| ^~~~
| scanf
a.cc:9:13: error: 'n' was not declared in this scope
9 | sort(a, a+n);
| ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
9 | sort(a, a+n);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
|
s356240363 | p03694 | C++ | #include<cstdio>
#include<algorithm>
int main(){
int n;
scanf("%d",&n);
int a[100];
for(int i=0;i<n;i++){
scanf("%d",a[i]);
}
sort(a,a+n);
print("%d",a[n-1]-a[0]);
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
11 | sort(a,a+n);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
a.cc:12:9: error: 'print' was not declared in this scope; did you mean 'printf'?
12 | print("%d",a[n-1]-a[0]);
| ^~~~~
| printf
|
s350072252 | p03694 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(void)
{
int N;
cin>>N;
Vector<int> pos(N);
for(int i=0;i<N;i++)
{
cin>>pos[i];
}
int a,b;
int max,min;
for(int i=0;i<N;i++)
{
if(max<pos[i])
max=pos[i];
}
min=max;
for(int i=0;i<N;i++)
{
if(pos[i]<min)
min=pos[i];
}
cout<<max-min<<endl;
} | a.cc: In function 'int main()':
a.cc:13:3: error: 'Vector' was not declared in this scope
13 | Vector<int> pos(N);
| ^~~~~~
a.cc:13:10: error: expected primary-expression before 'int'
13 | Vector<int> pos(N);
| ^~~
a.cc:17:10: error: 'pos' was not declared in this scope
17 | cin>>pos[i];
| ^~~
a.cc:25:12: error: 'pos' was not declared in this scope
25 | if(max<pos[i])
| ^~~
a.cc:33:8: error: 'pos' was not declared in this scope
33 | if(pos[i]<min)
| ^~~
|
s205303846 | p03694 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(void)
{
int N;
cin>>N;
Vector<int> pos(N);
int a,b;
int max,min;
for(int i=0;i<N;i++)
{
if(max<pos[i])
max=pos[i];
}
min=max;
for(int i=0;i<N;i++)
{
if(pos[i]<min)
min=pos[i];
}
cout<<max-min<<endl;
} | a.cc: In function 'int main()':
a.cc:13:3: error: 'Vector' was not declared in this scope
13 | Vector<int> pos(N);
| ^~~~~~
a.cc:13:10: error: expected primary-expression before 'int'
13 | Vector<int> pos(N);
| ^~~
a.cc:20:12: error: 'pos' was not declared in this scope
20 | if(max<pos[i])
| ^~~
a.cc:28:8: error: 'pos' was not declared in this scope
28 | if(pos[i]<min)
| ^~~
|
s335248621 | p03694 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(void)
{
int N;
Vector<int> pos(N);
int a,b;
int max,min;
for(int i=0;i<N;i++)
{
if(max<pos[i])
max=pos[i];
}
min=max;
for(int i=0;i<N;i++)
{
if(pos[i]<min)
min=pos[i];
}
cout<<max-min<<endl;
} | a.cc: In function 'int main()':
a.cc:10:3: error: 'Vector' was not declared in this scope
10 | Vector<int> pos(N);
| ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
10 | Vector<int> pos(N);
| ^~~
a.cc:17:12: error: 'pos' was not declared in this scope
17 | if(max<pos[i])
| ^~~
a.cc:25:8: error: 'pos' was not declared in this scope
25 | if(pos[i]<min)
| ^~~
|
s366081960 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int ma=a[0],mi=a[0];
for(i=1;i<n;i++){
ma=max(ma,a[i]);
mi=min(mi,a[i]);
}
cout<<ma-mi;
} | a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope; did you mean 'mi'?
12 | for(i=1;i<n;i++){
| ^
| mi
|
s868560097 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}
signed main() {
int N;
cin >> N;
vi a(N);
rep(i, N) cin >> a[i];
SORT(a);
int sum = 0;
FOR(i, 1, N) {
sum += a[i]-a[i-1];
}
cout << sum << endl;
return 0; | a.cc: In function 'int main()':
a.cc:37:14: error: expected '}' at end of input
37 | return 0;
| ^
a.cc:23:15: note: to match this '{'
23 | signed main() {
| ^
|
s102301924 | p03694 | C++ | #include <bits/stdc+.h>
using namespace std;
int main(){
int N;
cin >> N;
int L=0,U=1000,x;
for(int i=0;i<N;i++){
cin >> x;
L=max(L,x);
U=min(U,x);
}
cout << L-U;
} | a.cc:1:10: fatal error: bits/stdc+.h: No such file or directory
1 | #include <bits/stdc+.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s426642649 | p03694 | C++ | #include <bits/stdc++.h> // imports every library in c++
using namespace std; // ; is essential | says that you are USING the libraries
int N, max, min;
stack<int> A;
int main() {
cin >> N;
for ( int i=0; i<N; i++ ) {
cin >> max;
A.push(max);
}
max = 0;
min = 0;
for ( int i=0; i<N; i++ ) {
if (A.top() > max ) {
max = A.top();
}
if (A.top() < min ) {
min = A.top();
}
A.pop();
}
cout << max - min << "\n";
} | a.cc: In function 'int main()':
a.cc:9:16: error: reference to 'max' is ambiguous
9 | cin >> max;
| ^~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
In file included from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:8: note: 'int max'
4 | int N, max, min;
| ^~~
a.cc:10:16: error: reference to 'max' is ambiguous
10 | A.push(max);
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:8: note: 'int max'
4 | int N, max, min;
| ^~~
a.cc:12:5: error: reference to 'max' is ambiguous
12 | max = 0;
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:8: note: 'int max'
4 | int N, max, min;
| ^~~
a.cc:13:5: error: reference to 'min' is ambiguous
13 | min = 0;
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:13: note: 'int min'
4 | int N, max, min;
| ^~~
a.cc:15:23: error: reference to 'max' is ambiguous
15 | if (A.top() > max ) {
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:8: note: 'int max'
4 | int N, max, min;
| ^~~
a.cc:16:13: error: reference to 'max' is ambiguous
16 | max = A.top();
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:8: note: 'int max'
4 | int N, max, min;
| ^~~
a.cc:18:23: error: reference to 'min' is ambiguous
18 | if (A.top() < min ) {
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:13: note: 'int min'
4 | int N, max, min;
| ^~~
a.cc:19:11: error: reference to 'min' is ambiguous
19 | min = A.top();
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:13: note: 'int min'
4 | int N, max, min;
| ^~~
a.cc:23:11: error: reference to 'max' is ambiguous
23 | cout << max - min << "\n";
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:4:8: note: 'int max'
4 | int N, max, min;
| ^~~
a.cc:23:17: error: reference to 'min' is ambiguous
23 | cout << max - min << "\n";
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr _ |
s800509311 | p03694 | C++ |
int N, max, min;
stack<int> A;
int main() {
cin >> N;
for ( int i=0; i<N;; i++ ) {
cin >> max;
A.push(max);
}
max = 0;
min = 0;
for ( int i=0; i<N; i++ ) {
if (A.top() > max ) {
max = A.top();
}
if (A.top() < min ) {
min = A.top();
}
A.pop();
}
cout << max - min << "\n";
} | a.cc:3:1: error: 'stack' does not name a type
3 | stack<int> A;
| ^~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'min'?
5 | cin >> N;
| ^~~
| min
a.cc:6:24: error: expected primary-expression before ';' token
6 | for ( int i=0; i<N;; i++ ) {
| ^
a.cc:6:24: error: expected ')' before ';' token
6 | for ( int i=0; i<N;; i++ ) {
| ~ ^
| )
a.cc:6:26: error: 'i' was not declared in this scope
6 | for ( int i=0; i<N;; i++ ) {
| ^
a.cc:13:13: error: 'A' was not declared in this scope
13 | if (A.top() > max ) {
| ^
a.cc:16:13: error: 'A' was not declared in this scope
16 | if (A.top() < min ) {
| ^
a.cc:19:9: error: 'A' was not declared in this scope
19 | A.pop();
| ^
a.cc:21:3: error: 'cout' was not declared in this scope
21 | cout << max - min << "\n";
| ^~~~
|
s752758075 | p03694 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int n; cin>>n;
int mn=1000,mn=0;
rep(i,n){
int a; cin>>a;
mn=min(mn,a);
mx=max(mx,a);
}
cout<<mx-mn<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:21: error: redeclaration of 'int mn'
9 | int mn=1000,mn=0;
| ^~
a.cc:9:13: note: 'int mn' previously declared here
9 | int mn=1000,mn=0;
| ^~
a.cc:13:17: error: 'mx' was not declared in this scope; did you mean 'mn'?
13 | mx=max(mx,a);
| ^~
| mn
a.cc:15:15: error: 'mx' was not declared in this scope; did you mean 'mn'?
15 | cout<<mx-mn<<endl;
| ^~
| mn
|
s266079372 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)
#define ll long long int
#define ld long double
#define fr first
#define se second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v))))
#define pb push_back
#define mp make_pair
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define emla(a, val) memset(a, val, sizeof(a))
#define easm(a, b) (a + b - 1) /b
#define PI 3.141592653589793238
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
//bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;}
int n;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
//clock_t z = clock();
cin >> n;
vector<int>v(n);
for(auto &i : v)
cin >> i;
cout << s[n-1] - s[0] << endl;
//debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
/*
*try tricky test cases:
-bounds
-small input (0, 1)
-big input
-random tests
*/
return 0;
} | a.cc: In function 'int main()':
a.cc:49:11: error: 's' was not declared in this scope
49 | cout << s[n-1] - s[0] << endl;
| ^
|
s208145437 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;cin>>n>>k;int ans=0;vector<int>v;
for(int x=0;x<n;x++){
int a;cin>>a;v.push_back(a);
}
sort(v.begin(),v.end());
int ans=v[n-1]-v[0];
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:9:13: error: redeclaration of 'int ans'
9 | int ans=v[n-1]-v[0];
| ^~~
a.cc:4:31: note: 'int ans' previously declared here
4 | int n,k;cin>>n>>k;int ans=0;vector<int>v;
| ^~~
|
s451314732 | p03694 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x, arr[105];
cin >> x;
for(int i=1; I<=x;i++){
cin >> arr[i];
}
sort(arr+1, arr+1+x);
cout << arr[x]-arr[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:14: error: 'I' was not declared in this scope
7 | for(int i=1; I<=x;i++){
| ^
|
s863540872 | p03694 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x, arr[105];
cin >> x;
for(int i=1; i<+n;i++){
cin >> arr[i];
}
sort(arr+1, arr+1+n);
cout << arr[n]-arr[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:17: error: 'n' was not declared in this scope
7 | for(int i=1; i<+n;i++){
| ^
a.cc:10:19: error: 'n' was not declared in this scope
10 | sort(arr+1, arr+1+n);
| ^
|
s030603234 | p03694 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x, arr[105];
cin >> x;
for(int i=1; I<+n;i++){
cin >> arr[i];
}
sort(arr+1, arr+1+n);
cout << arr[n]-arr[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:14: error: 'I' was not declared in this scope
7 | for(int i=1; I<+n;i++){
| ^
a.cc:7:17: error: 'n' was not declared in this scope
7 | for(int i=1; I<+n;i++){
| ^
a.cc:10:19: error: 'n' was not declared in this scope
10 | sort(arr+1, arr+1+n);
| ^
|
s962478633 | p03694 | C++ | //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;
int main() {
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(false);
int N, vector<int> A(N);
rep(i, 0, N) cin >> A[i];
cout << *max_element(A.begin(), A.end()) - *min_element(A.begin(), A.end()) << endl;
}
| a.cc: In function 'int main()':
a.cc:13:24: error: invalid declarator before 'A'
13 | int N, vector<int> A(N);
| ^
a.cc:14:25: error: 'A' was not declared in this scope
14 | rep(i, 0, N) cin >> A[i];
| ^
a.cc:15:26: error: 'A' was not declared in this scope
15 | cout << *max_element(A.begin(), A.end()) - *min_element(A.begin(), A.end()) << endl;
| ^
|
s754593547 | p03694 | C++ | #include <iostream> | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s205137313 | p03694 | C++ | ource Code
Copy
Copy
#include <bits/stdc++.h>
using namespace std;
int N, a, maks = 0, mins = 1100;
int main() {
cin >> N;
for (int i = 1; i <= N; i++)
{
cin >> a;
if (a > maks)
{
maks = a;
}
if (a < mins)
{
mins = a;
}
}
cout << maks - mins << endl;
cin.get();
return 0; | a.cc:1:1: error: 'ource' does not name a type
1 | ource Code
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:5:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/cstddef:50,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) nullptr_t;
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) nullptr_t;
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59,
from /usr/include/c++/14/bits/stl_algo.h:69,
from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/ |
s778808027 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int k;
set<int> s;
int t = n;
while(t--)
{
cin>>k;
s.insert(k);
}
int d = *(s.end()-1) - *s.begin();
cout<<d<<endl;
| a.cc: In function 'int main()':
a.cc:17:26: error: no match for 'operator-' (operand types are 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} and 'int')
17 | int d = *(s.end()-1) - *s.begin();
| ~~~~~~~^~
| | |
| | int
| std::set<int>::iterator {aka std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator}
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::reverse_iterator<_Iterator>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::move_iterator<_IteratorL>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)'
370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::complex<_Tp>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)'
379 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::complex<_Tp>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)'
388 | operator-(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: mismatched types 'const std::complex<_Tp>' and 'int'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)'
465 | operator-(const complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:17:27: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::valarray<_Tp>'
17 | int d = *(s.end()-1) - *s.begin();
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:17:27: note: 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} is not derived from 'const std::valarray<_Tp>'
17 | int d = *(s.end()-1) - *s.begin();
| |
s628091181 | p03694 | C++ | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ff first
#define ss second
#define ll long long
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define repr(i, a, n) for (int i = (n); i >= (a); --i)
using namespace std;
const int INF(1 << 30);
const ll LLINF(1LL << 55LL);
const int pi = 3.1415926536;
const int MOD = 1000000007;
void Main() {
int N;
cin >> N;
int max = -INF, min = INF;
rep(i, 0, N) {
int a;
cin >> a;
if (a > max) max = a;
if (a < min) min = a;
}
cout << max - min << endl;
}
int main() {
std::cin.tie(nullptr); // 標準入出力高速化
std::ios_base::sync_with_stdio(false); // SとS++の入出力出力を非同期
std::cout << std::fixed << std::setprecision(15); // 小数を10進数表示
Main();
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ff first
#define ss second
#define ll long long
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define repr(i, a, n) for (int i = (n); i >= (a); --i)
using namespace std;
const int INF(1 << 30);
const ll LLINF(1LL << 55LL);
const int pi = 3.1415926536;
const int MOD = 1000000007;
void Main() {
int N;
cin >> N;
int max = -INF, min = INF;
rep(i, 0, N) {
int a;
cin >> a;
if (a > max) max = a;
if (a < min) min = a;
}
cout << max - min << endl;
}
int main() {
std::cin.tie(nullptr); // 標準入出力高速化
std::ios_base::sync_with_stdio(false); // SとS++の入出力出力を非同期
std::cout << std::fixed << std::setprecision(15); // 小数を10進数表示
Main();
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ff first
#define ss second
#define ll long long
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define repr(i, a, n) for (int i = (n); i >= (a); --i)
using namespace std;
const int INF(1 << 30);
const ll LLINF(1LL << 55LL);
const int pi = 3.1415926536;
const int MOD = 1000000007;
void Main() {
int N;
cin >> N;
int max = -INF, min = INF;
rep(i, 0, N) {
int a;
cin >> a;
if (a > max) max = a;
if (a < min) min = a;
}
cout << max - min << endl;
}
int main() {
std::cin.tie(nullptr); // 標準入出力高速化
std::ios_base::sync_with_stdio(false); // SとS++の入出力出力を非同期
std::cout << std::fixed << std::setprecision(15); // 小数を10進数表示
Main();
} | a.cc: In function 'int main()':
a.cc:77:13: error: a function-definition is not allowed here before '{' token
77 | void Main() {
| ^
a.cc:90:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
90 | int main() {
| ^~
a.cc:90:9: note: remove parentheses to default-initialize a variable
90 | int main() {
| ^~
| --
a.cc:90:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:90:12: error: a function-definition is not allowed here before '{' token
90 | int main() {
| ^
a.cc:142:2: error: expected '}' at end of input
142 | }
| ^
a.cc:43:12: note: to match this '{'
43 | int main() {
| ^
|
s361544321 | p03694 | Java | import java.io.*;
import java.util.StringTokenizer;
import java.util.Arrays;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args) {
new Main().solve();
}
private void solve() {
try(InputReader in = new InputReader(System.in);
PrintWriter out = new PrintWriter(System.out)) {
int n = in.nextInt();
int[] a = in.mapInt(n);
Arrays.parallelSort(a);
int ans = a[n-1] - a[0];
out.println(ans);
}
catch(IOException e) {
System.err.println(e);
}
}
int atoi(String s) { return Integer.parseInt(s); }
long atol(String s) { return Long.parseLong(s); }
static class InputReader implements AutoCloseable {
public BufferedReader br;
public StringTokenizer st;
public InputReader(InputStream stream) {
br = new BufferedReader(new InputStreamReader(stream), 32768);
st = null;
}
public String nextLine() throws IOException {
return br.readLine();
}
public String next() {
if (st == null || !st.hasMoreTokens()) {
try { st = new StringTokenizer(br.readLine());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
return st.nextToken();
}
public int nextInt() { return Integer.parseInt(next()); }
public long nextLong() { return Long.parseLong(next()); }
int[] mapInt(int len) {
int[] ret = new int[len];
for (int i = 0; i < len; i++) ret[i] = Integer.parseInt(next());
return ret;
}
long[] mapLong(int len) {
long[] ret = new long[len];
for (int i = 0; i < len; i++) ret[i] = Long.parseLong(next());
return ret;
}
@Override public void close() throws IOException { br.close(); }
} | Main.java:64: error: reached end of file while parsing
}
^
1 error
|
s701954701 | p03694 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
int a;
vector<int> b(a);
rep(i,a)
cin>>b.at(i);
sort(all(b));
cout<<b.at(a.size()-1)-b.at(0);
} | a.cc: In function 'int main()':
a.cc:15:16: error: request for member 'size' in 'a', which is of non-class type 'long long int'
15 | cout<<b.at(a.size()-1)-b.at(0);
| ^~~~
|
s859411545 | p03694 | C++ | #include<bits/stdc++.h>
using namesapce std;
int main(){
int a,b[10000000];
cin>>a;
for(int i=0;i<a:i++){
cin>>b[i];
}
sort(b,b+a);
cout<b[a-1]-b[0]<<"\n";
} | a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>a;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
6 | for(int i=0;i<a:i++){
| ^
a.cc:6:16: error: found ':' in nested-name-specifier, expected '::'
6 | for(int i=0;i<a:i++){
| ^
| ::
a.cc:6:15: error: 'a' is not a class, namespace, or enumeration
6 | for(int i=0;i<a:i++){
| ^
a.cc:9:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
9 | sort(b,b+a);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout<b[a-1]-b[0]<<"\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:17: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
10 | cout<b[a-1]-b[0]<<"\n";
| ~~~~~~~~~~~^~~~~~
| | |
| int const char [2]
a.cc:10:23: error: expected ')' before ';' token
10 | cout<b[a-1]-b[0]<<"\n";
| ^
| )
a.cc:6:4: note: to match this '('
6 | for(int i=0;i<a:i++){
| ^
|
s422104533 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int N;
cin >> N;
vector<int> vec(N);
for (int i = 0; i < N; i++){
cin >> vec[i];
}
cout << max(vec) - min(vec) << endl;
}
| a.cc: In function 'int main()':
a.cc:14:16: error: no matching function for call to 'max(std::vector<int>&)'
14 | cout << max(vec) - min(vec) << endl;
| ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed:
a.cc:14:16: note: 'std::vector<int>' is not derived from 'std::initializer_list<_Tp>'
14 | cout << max(vec) - min(vec) << endl;
| ~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided
a.cc:14:27: error: no matching function for call to 'min(std::vector<int>&)'
14 | cout << max(vec) - min(vec) << endl;
| ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: template argument deduction/substitution failed:
a.cc:14:27: note: 'std::vector<int>' is not derived from 'std::initializer_list<_Tp>'
14 | cout << max(vec) - min(vec) << endl;
| ~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate expects 2 arguments, 1 provided
|
s482652201 | p03694 | C++ | #include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.begin(), x.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5 << 28, MOD = 1e9 + 7;
int N, M, K;
vi A, B;
string S, T;
void input() {
int x, y, z;
;
cin >> N;
A.resize(N);
rep(i, 0, N - 1) { cin >> A[i]; }
}
void solve() {
sort(A);
int ans = 0;
rep(i, 1, N - 1) { ans += A[i] - A[i - 1]; }
cout << ans << endl;
;
;
}
signed main() {
input();
solve();
return 0;
} | a.cc: In function 'void solve()':
a.cc:26:7: error: no matching function for call to 'sort(vi&)'
26 | sort(A);
| ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
|
s383730409 | p03694 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> vec(n);
for(int i=0;i<n;i++){
cin >>vec.at(i);
}
sort(vec.begin(),vec.end());
cout << vec.at(n-1) - vec.at(0) << endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
7 | vector<int> vec(n);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <math.h>
+++ |+#include <vector>
3 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
7 | vector<int> vec(n);
| ^~~
a.cc:9:11: error: 'vec' was not declared in this scope
9 | cin >>vec.at(i);
| ^~~
a.cc:11:10: error: 'vec' was not declared in this scope
11 | sort(vec.begin(),vec.end());
| ^~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
11 | sort(vec.begin(),vec.end());
| ^~~~
| sqrt
|
s198813194 | p03694 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int n;
cin >>n;
vector<int> vec(n);
for(int i=0;i<n;i++){
cin >>vec.at(i);
}
sort(vec.begin(),vec.end());
cout << vec.at(n-1) - vec.at(0) << endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
7 | vector<int> vec(n);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <math.h>
+++ |+#include <vector>
3 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
7 | vector<int> vec(n);
| ^~~
a.cc:9:11: error: 'vec' was not declared in this scope
9 | cin >>vec.at(i);
| ^~~
a.cc:11:10: error: 'vec' was not declared in this scope
11 | sort(vec.begin(),vec.end());
| ^~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
11 | sort(vec.begin(),vec.end());
| ^~~~
| sqrt
|
s321254373 | p03694 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int n;
vector<int> vec(n);
for(int i=0;i<n;i++){
cin >>vec.at(i);
}
sort(vec.begin(),vec.end());
cout << vec.at(n-1) - vec.at(0) << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector<int> vec(n);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <math.h>
+++ |+#include <vector>
3 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
6 | vector<int> vec(n);
| ^~~
a.cc:8:11: error: 'vec' was not declared in this scope
8 | cin >>vec.at(i);
| ^~~
a.cc:10:10: error: 'vec' was not declared in this scope
10 | sort(vec.begin(),vec.end());
| ^~~
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
10 | sort(vec.begin(),vec.end());
| ^~~~
| sqrt
|
s240480777 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
set<int> set;
int a;
for(int i = 0;i < n;i++) {
cin >> a;
set.insert(a);
}
cout << *rbegin() - *begin() << endl;
} | a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to 'rbegin()'
12 | cout << *rbegin() - *begin() << endl;
| ~~~~~~^~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:150:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.rbegin()) std::rbegin(_Container&)'
150 | rbegin(_Container& __cont) -> decltype(__cont.rbegin())
| ^~~~~~
/usr/include/c++/14/bits/range_access.h:150:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:161:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.rbegin()) std::rbegin(const _Container&)'
161 | rbegin(const _Container& __cont) -> decltype(__cont.rbegin())
| ^~~~~~
/usr/include/c++/14/bits/range_access.h:161:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:194:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::reverse_iterator<_Tp*> std::rbegin(_Tp (&)[_Nm])'
194 | rbegin(_Tp (&__arr)[_Nm]) noexcept
| ^~~~~~
/usr/include/c++/14/bits/range_access.h:194:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:216:5: note: candidate: 'template<class _Tp> constexpr std::reverse_iterator<const _Tp*> std::rbegin(initializer_list<_Tp>)'
216 | rbegin(initializer_list<_Tp> __il) noexcept
| ^~~~~~
/usr/include/c++/14/bits/range_access.h:216:5: note: candidate expects 1 argument, 0 provided
a.cc:12:29: error: no matching function for call to 'begin()'
12 | cout << *rbegin() - *begin() << endl;
| ~~~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
from /usr/include/c++/14/bits/stl_algo.h:59,
from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
88 | begin(initializer_list<_Tp> __ils) noexcept
| ^~~~~
/usr/include/c++/14/initializer_list:88:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
52 | begin(_Container& __cont) -> decltype(__cont.begin())
| ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
63 | begin(const _Container& __cont) -> decltype(__cont.begin())
| ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
95 | begin(_Tp (&__arr)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
1227 | begin(valarray<_Tp>& __va) noexcept
| ^~~~~
/usr/include/c++/14/valarray:1227:5: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
1238 | begin(const valarray<_Tp>& __va) noexcept
| ^~~~~
/usr/include/c++/14/valarray:1238:5: note: candidate expects 1 argument, 0 provided
|
s820699209 | p03694 | C++ |
int N, A, min = 1001, max = 01;
int main(){
std::cin >> N;
for(int i = 1; i <= N; i++){
std::cin >> A;
if(min > A) min = A;
if(max < A) max = A;
}
std::cout << max -min << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
4 | std::cin >> N;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:6:14: error: 'cin' is not a member of 'std'
6 | std::cin >> A;
| ^~~
a.cc:6:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:10: error: 'cout' is not a member of 'std'
10 | std::cout << max -min << std::endl;
| ^~~~
a.cc:10:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:36: error: 'endl' is not a member of 'std'
10 | std::cout << max -min << std::endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 |
|
s057072858 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> hou(n);
for(int i=0;i<n;i++){
cin>>house[i];
}
sort(hou.begin(),hou.end());
cout<<hou[n-1]-hou[0]<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:12: error: 'house' was not declared in this scope; did you mean 'hou'?
9 | cin>>house[i];
| ^~~~~
| hou
|
s744575452 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int hou[n];
for(int i=0;i<n;i++){
cin>>house[i];
}
sort(hou.begin(),hou.end());
cout<<hou[n-1]-hou[0]<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:12: error: 'house' was not declared in this scope; did you mean 'hou'?
9 | cin>>house[i];
| ^~~~~
| hou
a.cc:11:12: error: request for member 'begin' in 'hou', which is of non-class type 'int [n]'
11 | sort(hou.begin(),hou.end());
| ^~~~~
a.cc:11:24: error: request for member 'end' in 'hou', which is of non-class type 'int [n]'
11 | sort(hou.begin(),hou.end());
| ^~~
|
s718988637 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int house[n];
for(int i=0;i<n;i++){
cin>>house[i];
}
sort(house.begin(),house.end());
cout<<house[n-1]-house[0]<<endl;
} | a.cc: In function 'int main()':
a.cc:11:14: error: request for member 'begin' in 'house', which is of non-class type 'int [n]'
11 | sort(house.begin(),house.end());
| ^~~~~
a.cc:11:28: error: request for member 'end' in 'house', which is of non-class type 'int [n]'
11 | sort(house.begin(),house.end());
| ^~~
|
s569307457 | p03694 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FT first
#define SC second
using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef pair<int, int> pint;
const int INF = 1e9;
const double EPS = 1e-9;
int main()
{
int n ;
cin >> n ;
vector<int> poi(n) ;
int count = 0 ;
REP(i,n){
cin >> poi.at(i) ;
}
sort(ALL(poi)) ;
REP(i,n-1){
count += s.at(i+1)-s.at(i) ;
}
cout << count <<endl ;
return 0 ;
}
| a.cc: In function 'int main()':
a.cc:33:14: error: 's' was not declared in this scope
33 | count += s.at(i+1)-s.at(i) ;
| ^
|
s345720559 | p03694 | C++ | #include <iostream>
#include <vector>
int N;
using namespace std;
int main(){
cin >> N;
int maxa = -1; mina = 10000;
vector<int> a(N);
for(int i = 0; i < N; i++){
cin >> a[i];
if(a[i] <= mina) mina = a[i];
if(a[i] >= maxa) maxa = a[i];
}
cout << maxa - mina;
} | a.cc: In function 'int main()':
a.cc:10:18: error: 'mina' was not declared in this scope
10 | int maxa = -1; mina = 10000;
| ^~~~
|
s559617872 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> v(N);
for (int i=0;i<N;i++){
cin >> v[i];
}
v.sort(v.begin(),v.end());
cout << v[N-1]-v[0] << endl;
} | a.cc: In function 'int main()':
a.cc:11:5: error: 'class std::vector<int>' has no member named 'sort'
11 | v.sort(v.begin(),v.end());
| ^~~~
|
s703029470 | p03694 | C++ | #include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
using namespace std;
int main(){
int N; cin >> N;
int min = 1000; max = 0;
for(int i = 0; i > N; i++){
int tmp;
cin >> tmp;
if(tmp < min) tmp = min;
if(tmp > max) tmp = max;
}
cout << max - min << endl;
}
| a.cc: In function 'int main()':
a.cc:17:25: error: overloaded function with no contextual type information
17 | int min = 1000; max = 0;
| ^
a.cc:22:12: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
22 | if(tmp > max) tmp = max;
| ~~~~^~~~~
a.cc:22:25: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
22 | if(tmp > max) tmp = max;
| ^~~
a.cc:24:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
24 | cout << max - min << endl;
| ~~~~^~~~~
|
s590419037 | p03694 | C++ | #include <iostream>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <float.h>
#include <limits>
#include <vector>
#include <string.h>
#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define ll long long
#define asort(a) sort(a.begin(),a.end());
using namespace::std;
int jo(ll int jxo, ll int jyo){//累乗
ll int jhogeo = 1;
rep(jinto,0,jyo) jhogeo=jhogeo*jxo;
return jhogeo;
}
char tobig(char toxbig){//char大文字化
return (toxbig-0x20);
}
char tolow(char toxlow){//char小文字化
return (toxlow+0x20);
}
int ctoi(char cctoi){//char->int
if('0' <= cctoi && cctoi <= '9') return (cctoi-'0');
return -1;
}
int gcd(int gcad, int gcbd) {//最大公約数
if(gcad < gcbd) return gcd(gcbd, gcad);
int gcrd;
while ((gcrd=gcad%gcbd)) {
gcad = gcbd;
gcbd = gcrd;
}
return gcbd;
}
int lcm(int lcam, int lcbm){//最小公倍数
return (lcam*lcbm)/gcd(lcam,lcbm);
}
int main(){
int n;
cin>>n;
vecor<int> a(n);
rep(i,0,n) cin>>a[i];
asort(a);
cout<<a[n-1]-a[0];
}
// int *p = new int[N];
// vector<int> 変数名(要素数);
// sort(変数名.begin(),変数名.end());//昇順ソート
// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));
//
| a.cc: In function 'int main()':
a.cc:50:3: error: 'vecor' was not declared in this scope
50 | vecor<int> a(n);
| ^~~~~
a.cc:50:9: error: expected primary-expression before 'int'
50 | vecor<int> a(n);
| ^~~
a.cc:52:19: error: 'a' was not declared in this scope
52 | rep(i,0,n) cin>>a[i];
| ^
a.cc:53:9: error: 'a' was not declared in this scope
53 | asort(a);
| ^
a.cc:14:23: note: in definition of macro 'asort'
14 | #define asort(a) sort(a.begin(),a.end());
| ^
|
s162318460 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int n,i;
cin >> n;
int a[n];
for( i = 0; i < n; i++){
cin >> a[i];
}
sort(a, a+n);
int ans = a[n-1] - a[0];
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(a, a+n);
| ^~~~
| short
|
s080222086 | p03694 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++){
cin >> a.at(i);
}
sort(a.begin(),a.end());
int ans = a.at(0) - a.at(n - 1);
cout << ans < endl;
}
| a.cc: In function 'int main()':
a.cc:13:15: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
13 | cout << ans < endl;
| ~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: couldn't deduce template parameter '_Bi_iter'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: couldn't deduce template parameter '_Bi_iter'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
13 | cout << ans < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
13 | cout << ans < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
13 | cout << ans < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: couldn't deduce template parameter '_CharT'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:13:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
13 | cout << ans < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:13:17: no |
s215612167 | p03694 | C++ | #include <iostream>
int main() {
int n = 0;
cin >> n;
int maxi = 0, mini = 100000;
int buf = 0;
for (int i=0; i<n; i++) {
std::cin >> buf;
if (buf > maxi) maxi = buf;
if (buf < mini) mini = buf;
}
std::cout << maxi - mini << endl;
retunr 0;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:13:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
13 | std::cout << maxi - mini << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:14:3: error: 'retunr' was not declared in this scope
14 | retunr 0;
| ^~~~~~
|
s134583479 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a;
cin>>a;
vector<int> b(a);
for(int i=0;i<s;i++)
cin>>b.at(i);
sort(b.begin(),b.end());
cout<<b.at(a-1)-b.at(0)<<endl;
} | a.cc: In function 'int main()':
a.cc:8:17: error: 's' was not declared in this scope
8 | for(int i=0;i<s;i++)
| ^
|
s771424914 | p03694 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a;
cin>>a;
vector<int> b(a);
for(int i=0;i<s;i++)
cin>>b.at(i);
sort(b.begin(),b.end());
cout<<b.at(a-1)-b.at(0)<<endl;
} | a.cc: In function 'int main()':
a.cc:8:17: error: 's' was not declared in this scope
8 | for(int i=0;i<s;i++)
| ^
|
s315114557 | p03694 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
int main() {
int N; cin >> N;
vi a(N); cin >> a.at(i);
cout << *max_element(all(a)) - *min_element(all(a)) << endl;
} | a.cc: In function 'int main()':
a.cc:23:24: error: 'i' was not declared in this scope
23 | vi a(N); cin >> a.at(i);
| ^
|
s262089050 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b, Mma=-1, min=1001;
cin >> a;
for(i=0;i<a;i++) {
cin >> b;
if(min>b) min=b;
if(Mma<b) Mma=b;
}
cout << Mma-min <<endl;
} | a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
6 | for(i=0;i<a;i++) {
| ^
|
s068167924 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b, Mma=-1, min=1001;
cin >> a;
for(i=0;i<a;i++){
cin >> b;
if(min>b) min=b;
if(Mma<b) Mma=b;
}
cout << Mma-min <<endl;
} | a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
6 | for(i=0;i<a;i++){
| ^
|
s894108480 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b, Mma=-1, min=1001;
cin >> a;
for(i=0;i<a;i++){
cin >> b;
if(min>b) min=b;
if(Mma<b) Mma=b;
}
cout << Mma+min <<endl;
} | a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
6 | for(i=0;i<a;i++){
| ^
|
s011234394 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b[1000],Mma=-1,min=1001;
cin >> a;
for(i=0;i<a;i++){
cin >> b;
if(min>b) min=b;
if(Mma<b) Mma=b;
}
cout << Mma+min <<endl;
} | a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
6 | for(i=0;i<a;i++){
| ^
a.cc:7:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1000]')
7 | cin >> b;
| ~~~ ^~ ~
| | |
| | int [1000]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
7 | cin >> b;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(short int)((int*)(& b))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(short unsigned int)((int*)(& b))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(int)((int*)(& b))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(unsigned int)((int*)(& b))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(long int)((int*)(& b))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(long unsigned int)((int*)(& b))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(long long int)((int*)(& b))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
7 | cin >> b;
| ^
| |
| int*
a.cc:7:10: error: cannot bind rvalue '(long long unsigned int)((int*)(& b))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:7:10: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
7 | cin >> b;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [1000]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [1000]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [1000]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [1000]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [1000]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with |
s619198749 | p03694 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b[1000],Mma=-1,min=1001;
cin >> a;
for(i=0;i<a;i++){
cin >>b;
if(min>b) min=b;
if(Mma<b)Mma=b;
}
cout << Mma+min <<endl;
} | a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
7 | for(i=0;i<a;i++){
| ^
a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1000]')
8 | cin >>b;
| ~~~ ^~~
| | |
| | int [1000]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
8 | cin >>b;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(short int)((int*)(& b))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(short unsigned int)((int*)(& b))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(int)((int*)(& b))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(unsigned int)((int*)(& b))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(long int)((int*)(& b))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(long unsigned int)((int*)(& b))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(long long int)((int*)(& b))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
8 | cin >>b;
| ^
| |
| int*
a.cc:8:9: error: cannot bind rvalue '(long long unsigned int)((int*)(& b))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:9: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
8 | cin >>b;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [1000]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [1000]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [1000]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [1000]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [1000]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istrea |
s226146274 | p03694 | C++ | #include<its/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
vector<int> a(n);
for(int i=0;i<n;i++)cin>>a.at(i);
sort(a.begin(),a.end());
cout<<a.at(n-1)-a.at(0)<<endl;
} | a.cc:1:9: fatal error: its/stdc++.h: No such file or directory
1 | #include<its/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.